Home

RCF User Manual - Tools for Smart Minds

image

Contents

1. 35 Remote control functionalities CO ide CMT 14 Creating remote controls 14 lodo a means 14 Explaining remote controls 11 Kp 15 Results Chart TES rt 21 Common features 20 General advices 21 Histogram result 22 Piechart result 22 Tapie result RET 23 Text result anni ne 21 XY Chart result 23 5 System status refreshStatus vi 29 Status lap u ec Oi una er 29 T Text properties Remote Control Framework User Manual Default value eee ener 24 U NA ad di Users eee 9 19 20 21 23 26 29 Required field 24 32 VID sO RER 10 VIP packages 10 42
2. Blank VI ie Polymorphic VI I From Template CHE Frameworks amp Design Patterns i i Ar Dialog Using Events SubVI with Error Handling HES Instrument 1 0 GPIB PO Read and Display Simulated 4 A Generate and Display A Load from File and Display Tutorial Getting Started 749 Generate and Display E Generate Analyze and Display CHE User Browse EH Project m Empty Project Project from Wizard i Real Time Project gt Other Files Creates a LabVIEW class r Custom Control Global Variable 3 Library Add to project B Run Time Menu o proj B XControl a allar FIGURE 13 CREATING A NEW CLASS IN LABVIEW Assign a name to the new class as shown below Please enter a name for your new class LightSwitch FiGURE 14 SPECIFY THE NAME OF THE NEW CLASS 16 Remote Control Framework User Manual Open class property window and modify class inheritance so that it inherits from the Command class as indicated in the figure below 8 LightSwitchvclass Class Properties PU On Category P General Settings Protection Inheritance Hierarchy Documentation Class Name Class Description Item Settings LabVIEW Object The LabVIEW Object is a built in LabVIEW class from w Friends LightSwitch lvclass Probes Wire Appearance Change Inheritance B Transfer all Must Override requirements to descendant clas
3. August 2013 Edition Remote Control Framework User Manual Worldwide technical support and product information www toolsforsmartminds com TOOLS for SMART MINDS Corporate headquarter Via Padania 16 Castel Mella 25030 Brescia Italy Copyright 2013 Tools for Smart Minds All rights reserved Remote Control Framework User Manual CONTENTS ABOUT THIS MANUAL CONVENTIONS GETTING STARTED WITH RCF REQUIREMENTS REMOTE CONSOLE CLIENT APPS INSTALLATION SYSTEM INTERFACE INITIALIZATION CREATING A CATALOG RUNNING RCF STOPPING RCF CREATING A REMOTE CONTROL CREATING A COMMAND Placing a LabVIEW object on the block diagram RETURNING A RESULT AFTER COMMAND EXECUTION RESULT TYPES Text Chart Histogram Piechart XY Chart Table PROTECTING COMMANDS WITH A PASSWORD ADDING FIELDS TO A COMMAND FIELD TYPES Text CheckboxField ListboxField NumericField 10 10 10 11 12 13 13 13 14 16 20 20 20 21 21 22 22 23 Z3 24 24 24 24 23 25 25 Remote Control Framework User Manual Creating a command with fields Adding help Field update modes PUBLISHING SYSTEM STATUS MANAGING EVENTS WHEN A CONNECTION STARTS STOPS MANAGING THEMES PROTECTING REMOTE CONTROL WITH A PASSWORD ADVANCED FEATURES EDITING CATALOG AT RUN TIME ADDING CLASSES TO CATALOG PUBLISHING REAL TIME DATA PUBLISHING REAL TIME ANALOG DATA PUBLISHING REAL TIME DIGITAL DATA ADD
4. Samples to acquire The first is a listbox and values are populated at runtime with the names of active devices The second parameter has a default value of 100 samples Remember that fields are displayed to user in the same order they are placed into the field s array Parameters and Password x Select acquisition device Dev2 required OK Z FIGURE 29 A FORM WITH TWO PARAMETERS GENERATED BY RCF RCF marks required fields with an asterisk User has to fill the form and press OK to send a request to your application This ensures that all required fields are received by execute vi method when invoked When a user sends its requests RCF collects field values into a string array available from query objects For example if a field value is a numeric field it must be converted in a numeric format The following block diagram shows what explained before errorin error Masa error out Please type a number of samples between 1 and 500 device name number of samples myCommandin m myCommand Out FIGURE 30 EXECUTE VI PROCESS DATA ACCORDING TO FIELD VALUES Notice that field values are processed in the same order they are placed into field array when command has been created Second field Samples to acquire is checked if its value is included in range 1 5 acquisition is executed otherwise a text result is used to advice user that
5. 22 EXECUTE VI METHOD WHICH RETURNS AN HISTOGRAM RESULT FIGURE 23 EXECUTE VI METHOD WHICH RETURNS A PIE CHART RESULT FIGURE 24 EXECUTE VI METHOD WHICH RETURNS A XYCHART RESULT FIGURE 25 EXECUTE VI METHOD WHICH RETURNS A TABLE RESULT FIGURE 26 FIELDS PALETTE FIGURE 27 SETTING A NUMERIC FIELD FIGURE 28 A COMMAND IS CREATED WITH TWO FIELDS FIGURE 29 A FORM WITH TWO PARAMETERS GENERATED BY RCF FIGURE 30 EXECUTE VI PROCESS DATA ACCORDING TO FIELD VALUES FIGURE 31 USE WRITE HELP VI TO ADD A HELP TEXT FIGURE 32 UsE WRITE UPDATEMODE VI TO SET THE PROPER VALUE UPDATE MODE FOR EVERY FIELD FIGURE 33 USE POLYMORPHIC REFRESHFIELDVALUE VI TO UPDATE FIELD VALUES TO ALL CLIENTS FIGURE 34 REFRESHSTATUS VI TRANSMITS THE SYSTEM STATUS TO ALL CONNECTED CLIENTS FIGURE 35 ASSOCIATE YOUR CUSTOM COMMAND OBJECT TO THE NEW CONNECTION EVENT FIGURE 36 INTERNAL CODE GENERATED TO ASSOCIATE THREE PARAMETERS TO YOUR CUSTOM COMMAND FOR NEW CONNECTION EVENT FIGURE 37 ASSOCIATE YOUR CUSTOM COMMAND OBJECT TO THE CLOSE CONNECTION EVENT FIGURE 38 INTERNAL CODE GENERATED TO ASSOCIATE TWO PARAMETERS TO YOUR CUSTOM COMMAND FOR CLOSED CONNECTION EVENT FIGURE 39 LOADING A THEME WITH LOAD THEME VI METHOD FIGURE 40 PROTECTING A REMOTE CONTROL WITH WRITE PASSWORD VI METHOD FIGURE 41 EDITING SAVING AND PUBLISHING CATALOG WITH THREE METHODS FIGURE 42 PUBLISHING REAL TIME ANALOG DATA FIGURE 43 PUBLISHING REAL TIME DIGITAL DATA F
6. Avoid sending multiple results with a single command if your clients have no capability to display them Unnecessary results consume communication band and make difficult to understand how your system is working TEXT Text result returns a string to a client who made the request The following figure illustrates the block diagram of a command which executes some actions and returns the completion time to user Error result FiGURE 20 EXECUTE VI METHOD WHICH RETURNS TEXT RESULT CHART Chart result returns a static chart composed of a single plot A command can customize chart title axis labels and plot color The following example illustrates a command that generates a Chart result with a random data plot uu result 100 Random data mass error out ra EB 1 xMultiplier myCommand In myCommand Out FIGURE 21 EXECUTE VI METHOD WHICH RETURNS A CHART RESULT 21 Remote Control Framework User Manual HISTOGRAM Histogram result returns a static histogram you can easily compose it as shown below with an array of clusters Each element contains three values bar label bar color and its value Notice that Y axis is not managed with auto scale so you have to set its minimum and maximum values 42 My first Histogram result x k K K Ls K K ELL LLL ELLE s 4 4 n others not spec myCommand In myCommand Out FIGURE 2
7. File Edit View Project Operate Tools Window Help Wl e3 amp x GO X Ry Fall S bj Project LightProject ivproj W My Computer co P LightSwitch A V F main vi Open Virtual Folder p E Dependencies Explore Property Definition Folder Build Specificat don le Dr VI from Dv Dispatch Template VI from Static Dispatch Template Add VI for Data Member Access VI for Override oo editor vi Command Editor Show Class Hierarchy encodeData vi encodeData gt load wi load quickCreate vi quickCreate Find d Read description vi Read description Read password vi Read password Find Project Items Read passwordRequired vi Read passwordRequin Arrange By gt ke er Expand All Collapse All Note The New Override dialog box does not list unsaved Vis You can override a VI from a ancestor Remove from Project class only if the VI has dynamic terminals on the Rename F2 connector pane and you have saved the VI to disk Replace with Properties Operate Tools Window Help 25 B Project LightProject lvproj E My Computer E LightSwitch lvclass QW LightSwitch ctl 8 executexi gt i main vi 8 7 Dependencies v WE Build Specifications FiGURE 16 COMMAND CLASS MUST OVERRIDE EXECUTE VI METHOD IMPORTANT Every command can be used if and only if it implements th
8. PROPER VALUE UPDATE MODE FOR EVERY FIELD 27 Remote Control Framework User Manual Use Write updateMode vi to set the proper way RCF client manages the field values By default RCF uses Default value update mode in order to maintain compatibility with previous versions of RCF clients RCF server can update field values at any time using polymorphic VI refreshFieldValue vi in RCF palette Notice that only fields defined with update mode serverValue are updated The figure below illustrates the code required to refresh the field value of the third field Target speed indicated in previous image Mumeric DOUBLE FiGURE 33 USE POLYMORPHIC REFRESHFIELDVALUE VI TO UPDATE FIELD VALUES TO ALL CLIENTS Field values are updated using their description as search key refreshFieldValue vi in previous figure associates Target speed rpm to the new value 1500 instead of 2000 used at definition time When a user execute the command that includes that field field value is 1500 instead of 2000 If you specify an empty string as field description refreshFieldValue vi returns an error If description string doesn t match any field description non error occurs but no updates are transmitted to clients 28 Remote Control Framework User Manual PUBLISHING SYSTEM STATUS RCF allows your server to publish a status table to all connected clients without explicit request Sending a system status is useful when clients need to know system
9. Write decimals vi by default RCF uses 0 decimal figures You can limit the numeric input range to clients using Write min amp maxValuea vi if you don t specify any range sets min and max value to gt and respectively and clients don t limit user inputs for numeric fields Required property does not apply to Numeric field because it is always returned regardless its value RCF supports two different styles for numeric fields The first one Defaul style is the classical style of numeric fields it is a box in which users types numbers The second style supported by is an horizontal bar You can set the value of the numeric field simply by moving the bar The following figure illustrates the case where a numeric field is created with 3 digits after decimal point a range between 10 and 40 and a default value of 20 Notice that default value has to be inside the specified range Humeric Target pressure PSI FIGURE 27 SETTING A NUMERIC FIELD CREATING A COMMAND WITH FIELDS The following block diagram shows a command with two fields The next figure illustrates how the form is displayed on client console a DAOmx System Get data samples cmdGetDataSamples This command returns aquired data from selected device FIGURE 28 A COMMAND IS CREATED WITH TWO FIELDS 25 Remote Control Framework User Manual Command called get data samples has two fields called respectively Select acquisition Device and
10. status changes whenever they happen IMPORTANT while results are sent to users who made specific requests system status is transmitted to all connected clients System status is transmitted as 2D table composed by two columns the first is the property name and the second one is the property value Suppose your system controls the temperature of a heat exchanger your system status can be as follow Property name Property value Oil temperature Water temperature None If you want to inform clients with system status when a warning is generated or status changes you have simply to publish the system status with refreshStatus vi as indicated below Current status FiGURE 34 REFRESHSTATUS VI TRANSMITS THE SYSTEM STATUS TO ALL CONNECTED CLIENTS The above example contains a constant status to explain how to format the 2D string array properly 29 Remote Control Framework User Manual MANAGING EVENTS WHEN A CONNECTION STARTS STOPS A catalog can contain two commands associated to specific events e New connection established executed every time a new client connects to server e Connection terminated executed every time a connection is terminated Connection can terminated for two reasons remote user closes the client app or timeout error occurs when due to poor quality of communication channel Create your own commands extending Command class and override execute vi methods The following figure il
11. understand that you server can publish analog data and prepare related data structures and tasks Configuration cluster is the classic system configuration cluster used by SCCT Refer to SCCT User Manual for more details 2 Publish analog data with publishAnalogData vi The following example illustrates the code necessary to complete this activity Configuration cluster FiGURE 42 PUBLISHING REAL TIME ANALOG DATA publishAnalogData vi requires a 2D DBL array in input that contains your analog data organized in rows every row contains samples of the same channel Optionally you can connect a 1D array of colors the number of color values has to be equal to the number of rows i e channels in 2D data 34 Remote Control Framework User Manual PUBLISHING REAL TIME DIGITAL DATA To publish real time digital data to clients you have to proceed as follow 1 Add a configuration cluster to RCF Manager vi with a description of digital lines you plan to publish This is necessary to client to understand that you server can publish digital data and prepare related data structures and tasks Configuration cluster is the classic system configuration cluster used by SCCT Refer to SCCT User Manual for more details 2 Publish digital line values with publishDigitalData vi The following example illustrates the code necessary to complete this activity Configuration cluster FiGURE 43 PUBLISHING REAL TIME DIGITAL DATA p
12. 2 EXECUTE VI METHOD WHICH RETURNS AN HISTOGRAM RESULT PIECHART Piechart result returns a static Pie chart where each slice is described by its label and value included into the range 1 360 as illustrated in the following figure PieChar Revenues 2012 lc query E Notnameica WS ris fures 4 result 1 ae America n myCommand In E 4 myCommand Out FIGURE 23 EXECUTE VI METHOD WHICH RETURNS A PIE CHART RESULT Avoid adding empty slices to pie chart i e slices with size equal to zero because pie chart legend has a limited dimension on mobile devices 22 Remote Control Framework User Manual XY CHART XY Chart result returns a static X Y chart Following figure shows the case a XY chart is created from data stored into a notifier This approach is used when a main application acquires and processes data in different tasks and your system makes last processed data available to users 10 Li 1 title L jp xAxis oes en error out FIGURE 24 EXECUTE VI METHOD WHICH RETURNS A XYCHART RESULT TABLE Table result returns a table You can customize rows and columns headers RCF checks that a column header array has the same size of the columns of the table If not so RCF removes unnecessary column headers or table columns without headers The following example shows the code necessary
13. IGURE 44 ADDING HELPURL TO RCF MANAGER 38 10 11 12 12 13 13 14 14 13 15 16 16 17 18 19 19 20 21 21 22 22 23 23 24 25 25 26 26 27 27 28 29 30 30 31 31 32 32 33 34 35 39 Remote Control Framework User Manual 39 Remote Control Framework User Manual 40 Remote Control Framework User Manual INDEX A adding Help URL 35 C Catalog functionalities UL ROTE ORE 33 Saving a created catalog 13 Uploading a catalog 12 Classes 33 Command class 16 Clients 8 9 10 12 13 20 21 24 32 37 Closed Connection Event 30 Commands functionalities Creating a command 16 Creating a command with fields 25 F Field Help 27 field Update Mode Server Value 27 Field Update Mode 27 Default Value 27 Last Value 27 Fields Checkbox field 25 defaultValue option 25 Listbox
14. ING SYSTEM HELP PAGE RCF CLIENTS FIGURE LIST INDEX 25 27 27 29 30 32 32 33 33 33 33 34 35 35 37 38 41 Remote Control Framework User Manual Remote Control Framework User Manual ABOUT THIS MANUAL CONVENTIONS The following conventions appear in this manual Bold italic monospace The symbol leads you through nested menu items and dialog box options to a final action The sequence Tools Options directs you to pull down the Tools menu select Options item Bold text denotes items that you must select or click on the software such as menu items and dialog box options Bold text also denotes parameter names Italic text denotes variables emphasis a cross reference or an introduction to a key concept This font also denotes text that is a placeholder for a word or value that you must supply Text in this font denotes text or characters that you should enter from the keyboard sections of code programming examples and syntax examples This font is also used for the proper names of disk drives paths directories programs subprograms subroutines device names functions operations variables filenames and extensions and code excerpts monospace italic Italic text in this font denotes text that is a placeholder for a word or value that you must supply Remote Control Framework User Manual Remote Control Framework User Manual GETTING S
15. It is the name of the remote control displayed by client s terminal ID It isa univocal number used by the Catalog displayed by client s terminal e Commands It is an array of objects created for executing functions associated to each remote control button FiGURE 9 COMMANDS ARE ASSOCIATED TO REMOTE CONTROL BUTTONS The previous figure illustrates the case some commands with red and yellow box are associated to multiple buttons on your remote control This is useful when a single command can execute different actions according to its input parameters so you don t need to create a separate command for every single action For instance if you want to manage a light switch instead of creating two commands called respectively SwitchLightOn and SwitchLightOff you can create a single command LightSwitch with a boolean input parameter called State indicating if light must be On or Off If you have multiple lights you can add a second parameter indicating which light has to be switched then you associate the command to different buttons with different titles Garden light ON Garden Light Off etc In the image below is illustrated the necessary code for creating a remote control denominated House lights FiGURE 10 A SIMPLE REMOTE CONTROL WITH FOUR COMMANDS 14 Remote Control Framework User Manual In this example the remote control is made up of four commands titled Garden Light On Garden Light Off Box Light On Box
16. Light Off These four simple commands have no parameters You will learn in the following chapters that each command can implement a simple function or manage complex activities according to the user s input and to the current status of the application You can select the display layout of the remote control on the client device through the Layout parameter Two types of layout are available e Standard layout This layout shows buttons and results in the same window An example of this layout is showed in the following figure Console first source Torque after test code 020882 Mod 14 55 Mod 1 35 Mod 14 20 Mod 14 20 Mod 14 35 Mod 14 55 Mod 1b 120 FIGURE 11 CLIENT WITH STANDARD INTERFACE FOR ANDROID OS e Remote control layout This remote control displays commands as a button list The following figure shows Remote Control Layout on RCF client for Android FIGURE 12 CLIENT WITH REMOTE CONTROL INTERFACE FOR ANDROID OS According to the different supported platforms there may be variations in the layout definition 15 Remote Control Framework User Manual CREATING A COMMAND Commands have to be created through the extension of the command class predefined in the RCF library The command class can t be modified in order to guarantee the code portability In order to create a new command follow the following steps Create a new class from File New as shown below Create New
17. M COMMAND FOR CLOSED CONNECTION EVENT 31 Remote Control Framework User Manual MANAGING THEMES RCF allows customizing client s aspect with themes A theme is a collection of properties that affects the aspect of RC buttons texts and background Themes are defined at server side so each application can include a specific theme When clients connect to server for the first time download theme package from server Theme data remain resident on smartphone Theme is a zip file that contains images in JPG format and a configuration file in XML format To add a theme to your catalog use load theme vi method as indicated in figure below FIGURE 39 LOADING A THEME WITH LOAD THEME VI METHOD If no theme is specified Clients use their default theme which may vary for every platform Android iOs HTML5 Notice that that RCF client for Windows does NOT support themes PROTECTING REMOTE CONTROL WITH A PASSWORD If a remote control has to be viewed by authorized staff only you have to associate a password blank passwords are not allowed for security reasons with that remote control When you select a remote control protected by a password a request is sent with the just typed password to the client The figure below illustrates how to protect a RC with a password using Write password vi method FIGURE 40 PROTECTING A REMOTE CONTROL WITH WRITE PASSWORD VI METHOD When user enter correct password associated to a remote con
18. Switch ctl u i execute vi z m main vi E Dependencies t Build Specifications RETURNING A RESULT AFTER COMMAND EXECUTION RESULT TYPES Commands can return to user one or more of the results indicated in this paragraph Keep in mind that not every client s interface can display multiple results at the same time Available result types are Text Chart e Histogram e Pie chart e XY Chart e Table Results can be placed on block diagram from the result subpalette as indicated in the figure below Commands Remote Control Framework FIGURE 19 RESULT CONSTANTS ARE IN RESULT PALETTE Although client s interfaces are not exactly the same on different platforms due to limits and particularities of their OS and capabilities some common features are guaranteed All results are displayed on black or very dark background e All charts are shown to fit client display regardless of its screen resolution e Table results can be browsed with scrollbars if needed e Text results are displayed without length restrictions RCF clients are available on different platforms from powerful PCs to old generation smartphones Some considerations have to be remarked about command s results 20 Remote Control Framework User Manual e Avoid sending large set of data unless necessary because devices with small computational power cannot manage them for example avoid sending charts with 10000 points e
19. TARTED WITH RCF In this chapter you are introduced to the main working elements of RCF In order to completely understand the RCF use and the programming library capability it is highly recommended to check the basics of object oriented programming methods OOP in LabVIEW The next diagram represents a generic LabVIEW application APPLICATION USER INTERFACE FILES DATABASE I O DEVICES FiGURE 1 GENERIC LABVIEW APPLICATION RCF extends your application with a new interface towards mobile devices such smartphones and tablets and towards web browsers Your system i e your application maintains its original desktop front end because RCF runs as a background service responsible to gather requests from connected clients sends these requests to your application for processing retrieves results and publishes them to clients Beside RCF is responsible to maintain connections validate requests and notify changes to your system interface One of the main advantages of RCF over traditional approach as web services is its capability to change system s interface at run time Your application is responsible to define its interface as a set of available functionalities called Commands in RCF terminology Example A simple data acquisition system may require a simplified interface with three commands Start e Start acquisition Stop e Stop acquisition Switch OFF e Switch system OFF When a client connects to RCF it receives a de
20. TS RCF is available as VIP package for LabVIEW 2010 or higher RCF requires SCCT Smartphone amp Cross platform Communication Toolkit available at http www toolsforsmartminds com products SCCT ph RCF can be downloaded at http www toolsforsmartminds com products remote control for labview ph REMOTE CONSOLE CLIENT APPS Remote console clients are available for different platforms and devices In this paragraph the platforms and URL where you can find RCF Clients are indicated At the time this manual has been redacted third party vendors are making their version of RCF client app and will be available from their web site Visit official page of RCF project to get more details Remote Control Client for windows developer edition is available at http www toolsforsmartminds com products remote control for labview ph INSTALLATION To install VIP packages you need VIP Manager from JKI you can download a free copy at www jki net Select an action to perform on the package 32010 lt Remote Control Framework Product Homepage sal Remote Control Framework v1 0 1 173 by TOOLS for SMART MINDS Author TOOLS for SMART MINDS Copyright Copyright c 2012 TOOLS for SMART MINDS Show in Palettes License TOOLS for SMART MINDS software agreement Compatible LabVIEW Versions 2010 Compatible 05 Versions Windows i Show Examples Description With Remote Control Framework RCF you c
21. an trasform your smartphone tablet into an universal remote control with custom commands capable to display charts Histograms tables and interactive interfaces This Package depends on these other packages smartphone amp crossplattform communication toolkit 2 1 3 201 FiGURE 3 RCF PACKAGE INSTALLATION WINDOW 10 Remote Control Framework User Manual RCF functions are available in the LabVIEW palette as indicated in the next image Functions z Remote control lan 1 1 1 9 Z lt E default PR PE EE RR UR default OO 900 default default VALUES FIGURE 4 RCF PALETTES INTO LABVIEW IDE Thanks to the control of your application RCF allows you to build an interface for a system in a simple and safe way SYSTEM INTERFACE The interface is built as a set of remote controls in this way you can organize system interface separating groups of commands in coherent sets of functionalities For example if you have a machine producing a certain product its interface could be constituted by three remote controls e Remote control A Commands to view statistics of production for management e Remote control B Commands to view edit machine parameters for technical staff e Remote control C Reserved commands for programmers 11 Remote Con
22. e listboxField represents a list of string values User can select one string value only e Numeric represents a numeric value both integer and real You can programmatically create and edit field using Fields palette indicated in the following figure Le LS EU P y Er FIGURE 26 FIELDS PALETTE The following paragraphs explain in detail several field types you can use in command s TEXT The Text field is a text string with no length limits It is possible define the following properties Name It is the name placed on the left of the text box in the form on your terminal e Default value it is the value given to you in the form on your terminal e Required field if Required property is True this field cannot contain an empty string 24 Remote Control Framework User Manual CHECKBOXFIELD Checkbox field is a Boolean value You can specify defaultValue to this field Required property doesn t apply to Checkbox field because it is always returned regardless its value LISTBOXFIELD Listbox field is a list of string values You can specify defaultValue and required properties Use Write values vi to specify strings that populate the list DefaultValue must be one of the values in the list NUMERICFIELD Numeric field is a numeric value You can specify defaultValue and required properties You can specify the number of decimal figures with
23. e execute method The following figure illustrates the default block diagram of execute vi method By default LabVIEW adds a call to ancestor class method 18 Remote Control Framework User Manual myCommand In myCommand Out FIGURE 17 DEFAULT BLOCK DIAGRAM CREATED BY LABVIEW WHEN YOU OVERRIDE EXECUTE VI METHOD Remove call to ancestor method and create a structure as follow FIGURE 18 EDITED BLOCK DIAGRAM WITH CASE STRUCTURE TO HANDLE ERROR IN At run time you can get information about e User who made the request e Additional field values typed by user to manage the request e Additional fields of the current command Add the code required to execute the command in the case indicated in the previous picture Notice that the above command returns an AbstractResult constant value which means that the client doesn t receive any notification that command has been executed With RCF your commands can return one or more results to client who made the request The following paragraph illustrates the different result types you can send to clients 19 Remote Control Framework User Manual PLACING A LABVIEW OBJECT ON THE BLOCK DIAGRAM After you create a class drag the class name or the associated ctl item on the diagram and LabVIEW creates an instance of selected class Edit View Project Operate Tools Window Help E bi Project LightProject lvproj Er My Computer LightSwitch lvclass POE Light
24. field 25 Numeric field 25 Text lie ee 24 Functions EditCatalog vi 13 CIOL MR 33 Eos c P une 15 LoadCatalog vi 13 RCF Manager vi 13 refreshCatalog vi 33 SaveCatalog vi 13 stopManager vi 13 I Introducing RCF Generic example of a labview application 8 RCF Interface ee 11 M Methods 41 EXOCUTE Vi u u u a us 26 Execute vi 17 24 writeClassList vi 33 N New Connection Event 30 P Parameters Catalog parameter 12 Logo path parameter 12 Password parameter 12 TCP port parameter 12 Welcome message parameter 12 Q Ci I Yuyu a akanki 9 R RCF requirement 10 Real time data 33 Analog Data 34 Digital Data
25. lustrates the necessary code to associate your custom command to New Connection event using Write onNewConnection vi method CmdOnNewConnection FIGURE 35 ASSOCIATE YOUR CUSTOM COMMAND OBJECT TO THE NEW CONNECTION EVENT Do not associate any field to those commands RCF creates automatically three fields filled at runtime with client information e Name It indicates the user name provided by client This value is useful when server needs to associate user names to their IP addresses e Timestamp It indicates the time connection has been established at server side e Platform It indicates which platform is used by client Android iOs LabVIEW HTML5 FIGURE 36 INTERNAL CODE GENERATED TO ASSOCIATE THREE PARAMETERS TO YOUR CUSTOM COMMAND FOR NEW CONNECTION EVENT The following figure illustrates the necessary code to associate your custom command to Closed Connection event using Write onClosedConnection vi method 30 Remote Control Framework User Manual CmdOnConnectionClosed FIGURE 37 ASSOCIATE YOUR CUSTOM COMMAND OBJECT TO THE CLOSE CONNECTION EVENT Do not associate any field to those commands RCF creates automatically two fields filled at runtime with client information e Reason It describes the reason connection has been closed e Timestamp It indicates the time connection has been closed at server side FIGURE 38 INTERNAL CODE GENERATED TO ASSOCIATE TWO PARAMETERS TO YOUR CUSTO
26. re added to catalog itself Use writeClassList vi method to include your custom commands to the catalog so that editor vi can properly manage all commands PUBLISHING REAL TIME DATA RCF allows publishing real time data to connected clients it means that your LabVIEW program can produce acquire analog and digital values and update client charts and tables in real time RCF is based on SCCT communication library and data are transferred through TCP permanent connections between server and clients to ensure that no data are lost Remember that displaying real time analog data on dynamic charts can be a CPU intensive task for mobile devices so it s your responsibility avoiding huge data packets to clients Usually users need or know signal trends or digital lines status so updating data to clients at high rate more than 10 times per seconds or sending hundreds or thousands of samples can be useless Notice also that RCF client do not perform log activities and all received data are displayed or discarded In the following paragraphs the case of analog and digital data are illustrated RCF allows publishing analog and digital data at the same time 33 Remote Control Framework User Manual PUBLISHING REAL TIME ANALOG DATA To publish real time analog data to clients you have to proceed as follow 1 Add a configuration cluster to RCF Manager vi with a description of analog channels you plan to publish This is necessary to client to
27. rogram you have to define an array composed of one or more remote controls RCF does not manage empty catalogues i e catalogues which don t include remote controls In the following figure is shown a catalog constituted by a remote control only commandList House s lights FIGURE 7 A CATALOG COMPOSED BY A SINGLE REMOTE CONTROL NAMED HOUSE S LIGHTS In this figure the catalog is saved in a file through the SaveCatalog vi function you can also use an already existing catalog by uploading it from a file through the LoadCatalog vi function You can create a catalog using the EditCatalog vi that you find in the LabVIEW palette pressing RCF Utilities With this utility you can define all of the catalog functional details at run time RUNNING RCF RCF has to be executed in your main application VI RCF creates additional threads to manage communication with clients Only one instance of RCF Manager vi can be executed into your application STOPPING RCF RCF runs in a separate loop from main application so you need to notify to RCF when application is terminated so that RCF itself stops execution To achieve this result use stopManager vi as shown in the figure below our code is here closeMainApp FIGURE 8 STOPMANAGR VI IS REQUIRED TO END RCF TASK 13 Remote Control Framework User Manual CREATING A REMOTE CONTROL A remote control is composed of the following elements e Description
28. scription of your system s interface and displays three buttons associated with the commands Every command can be parameterized or can be a simple button as the commands you have on a TV remote control Remote Control Framework User Manual RCF is integrated in the architecture represented in the previous figure in the following way Password MAIN APPLICATION FIGURE 2 RCF INTERACTIONS WITH USERS AND A GENERIC LABVIEW APPLICATION The above picture illustrates four steps involved in every user request At the beginning a user sends a request using one of available commands provided by RCF interface as indicated by Arrow number 1 RCF validates this request called query in RCF terminology and then invokes the function associated to that command as indicated by Arrow number 2 RCF interaction with your application is not limited to a specific protocol or pattern so you can apply the solution you think is best for your application Arrow 3 indicates that optionally the application can produce some results you want to return to the user as response to his request Arrow number 4 means that RCF results are formatted and returned to client into one of available defined formats that client s application is capable to display for example a chart or a table RCF manages all communication details in order to allow the programmer to focus on his own application Remote Control Framework User Manual REQUIREMEN
29. ses Data Value References Restrictions On New and Delete References of this class type are not restricted by any ancestor class Restrict references of this class type to member Vs of this class Restrict references of descendant class types to member VIs of this class Eh LabVIEW Object Selected Class LightSwitch lvclass Current Class Name Et AbstractClass lvclass E AbstractResult lvclass SS FE ChartResult lvclass Path HistogramResult lvclass C Program Files National Instruments PieChartResult lvclass LabVIEW 2012 vi lib TOOLS for SMART MINDS x TableResult lvclass nM TextResult lvclass XYChartResult lvclass Extend this class to create your own commands RemoteControl lvclass AbstractFilter lvclass ArrayFilter lvclass 1 StreamFilter lvclass AbstractintegrityConstrain lvclass AnalogDatalntegrityConstrain lvclass DigitalDatalntegrityConstrain ivclass AbstractPackage lvclass Arb nmularlneDarbane heelaoce FIGURE 15 INHERIT YOUR COMMANDS FROM COMMAND CLASS In the created class you can personalize class attributes and create methods necessary for handling these attributes RCF requires only one method of the extended class which has to be implemented for each new command the execute method Override this method and save it with name execute vi as shown below 17 Remote Control Framework User Manual lt L LightProject ivproj Project Explorer es x
30. the value is out of valid range 26 Remote Control Framework User Manual ADDING HELP Every field can include a Help text displayed on client form Use Write help vi method to add help text to a field as indicated in figure below Indicates the motor name you want to control If value is left empty first motor is selected by default FIGURE 31 USE WRITE HELP VI TO ADD A HELP TEXT FIELD UPDATE MODES Fields included in commands show values when user activates their associated command You can choose your favorite way to update the value displayed in a field RCF allows the use of three different field update modes e Default value RCF client displays always the default value defined in its command Even if user inserts a value default value will be shown at the next command execution e last value RCF client retains the last value edited from user At the first command execution RCF client uses default value indicated in command definition e Server value RCF client updates the field value with values received from server during connection time Updates are managed in background When user activates a command field values are the most recent values published by server A command can contain fields defined with different update modes The following example illustrates the case of a command composed by three fields with different update modes serverValue FIGURE 32 USE WRITE UPDATEMODE VI TO SET THE
31. to create a Table result Start time Alarm description E Le result FIGURE 25 EXECUTE VI METHOD WHICH RETURNS A TABLE RESULT The example above shows the case in which Table result includes column headers only Remember that column headers are necessary to clients in order to visualize properly the data of the table Row headers are not required RCF transmits as many rows as those included in items value 23 Remote Control Framework User Manual PROTECTING COMMANDS WITH A PASSWORD If a command has to be executed by authorized staff only you have to associate a password blank passwords are not allowed for security reasons with that command When you select a command protected by a password a request is sent with the just typed password to the client RCF validates the command execution request by verifying that the typed password is correct If the password is correct the execute method is invocated otherwise RCF notifies to the client that the typed password is not correct ADDING FIELDS TO A COMMAND If your command requires some input from user RCF allows you to define a form composed by a set of different fields Forms can be composed with three types of fields as explained below Forms have no limitation to the number of fields FIELD TYPES Available field types are e Text represents a generic string value e CheckboxField represents a Boolean value
32. trol RCF client display RC commands remembers that user knows the RC password and unlocks the RC for the current session User can move to other RCs and return to the password protected RC later without re entering the password 32 Remote Control Framework User Manual ADVANCED FEATURES In this paragraph are illustrated the RCF advanced functions Catalogs can be stored and loaded into form files You can create a catalog with custom commands save it into a file and distribute the catalog to other applications which includes RCF and the same classes Remember that a catalog is strictly tied to the LabVIEW classes created to extend Command class For this reason you have to be sure that executables contain at least a constant element for every class you have created EDITING CATALOG AT RUN TIME Editing catalog at run time is one of the advanced functions RCF includes editor vi a general purpose editor that you can use to create a complex catalog composed by one or more remote controls each with one or more commands With editor vi you can also customize every command with additional fields Catalogs can change at run time RCF does not publish catalog changes automatically so you have to use refreshCatalog vi as indicated in the following example FIGURE 41 EDITING SAVING AND PUBLISHING CATALOG WITH THREE METHODS ADDING CLASSES TO CATALOG Using editor vi to edit your catalog at run time requires that custom command classes a
33. trol Framework User Manual INITIALIZATION In order to initialize RCF you have to define the following parameters e TCP port it is the listening port for clients connections e Password it is the password that clients have to use to log in during the connection e Catalog it is the system interface that you want to provide The catalog is constituted by one or more remote controls In the same way each catalog is constituted by one or more commands e Welcome message it is a message that RCF sends to clients when the connection is opened e Logo path optional it is the absolute path of the logo which has to be displayed on the clients next to the welcome message A catalog can be either built programmatically in the applications or loaded from a file In the following example is showed how to use RCF with a catalog loaded from a file FIGURE 5 LOADING A CATALOG FORM FILE 1 AND LAUNCHING RCF 2 When clients connect to a system RCF sends a welcome message Welcome Message Welcome to my system Ok FIGURE 6 WELCOME MESSAGE DISPLAYED ON A RCF CLIENT FOR WEB BROWSER RCF allows you to use only one catalog at a time During the execution of your application you can e Modify the catalog by adding or removing remote controls e Modify the remote controls by adding or removing single commands 12 Remote Control Framework User Manual CREATING A CATALOG In order to create a catalog into a LabVIEW p
34. ublishDigitalData vi requires a 1D Boolean array in input that contains your digital line values Optionally you can connect two 1D arrays respectively for TRUE and FALSE colors the number of color values has to be equal to the number of digital lines in 1D data ADDING SYSTEM HELP PAGE In many real life applications it is important to create a web page that contains a description of your system with detailed explanations of RC s commands and their parameters You can specify the complete URL of that page to RCF Manager vi so that clients can display it to users To add a system help page simply connect the helpURL parameter as indicated in the following example FIGURE 44 ADDING HELPURL TO RCF MANAGER 35 Remote Control Framework User Manual 36 Remote Control Framework User Manual RCF CLIENTS RCF clients are available for different platforms and devices For a complete list of supported systems visit www toolsforsmartminds com products remote control for labview php The Remote Control client for Android OS is available at https play google com store apps details id SCCT Console The Remote control client for HTMLS is available at http www toolsforsmartminds com remote control html5 Remote control for HTML5 requires one of the following browsers e Google chrome e Mozilla Firefox e Internet Explorer 9 or higher with Flash Plugin e Safari The remote control for Windows XP 7 is available at http w
35. ww toolsforsmartminds com products remote control for labview ph This client created with LabVIEW includes installer and LabVIEW runtime engine Remote Control Framework User Manual FIGURE LIST FIGURE 1 GENERIC LABVIEW APPLICATION FIGURE 2 RCF INTERACTIONS WITH USERS AND A GENERIC LABVIEW APPLICATION FIGURE 3 RCF PACKAGE INSTALLATION WINDOW FIGURE 4 RCF PALETTES INTO LABVIEW IDE FIGURE 5 LOADING A CATALOG FORM FILE 1 AND LAUNCHING RCF 2 FIGURE 6 WELCOME MESSAGE DISPLAYED ON A RCF CLIENT FOR WEB BROWSER FIGURE 7 A CATALOG COMPOSED BY A SINGLE REMOTE CONTROL NAMED HOUSE S LIGHTS FIGURE 8 STOPMANAGR VI IS REQUIRED TO END RCF TASK FIGURE 9 COMMANDS ARE ASSOCIATED TO REMOTE CONTROL BUTTONS FIGURE 10 A SIMPLE REMOTE CONTROL WITH FOUR COMMANDS FIGURE 11 CLIENT WITH STANDARD INTERFACE FOR ANDROID OS FIGURE 12 CLIENT WITH REMOTE CONTROL INTERFACE FOR ANDROID OS FIGURE 13 CREATING A NEW CLASS IN LABVIEW FIGURE 14 SPECIFY THE NAME OF THE NEW CLASS FIGURE 15 INHERIT YOUR COMMANDS FROM COMMAND CLASS FIGURE 16 COMMAND CLASS MUST OVERRIDE EXECUTE VI METHOD FIGURE 17 DEFAULT BLOCK DIAGRAM CREATED BY LABVIEW WHEN YOU OVERRIDE EXECUTE VI METHOD FIGURE 18 EDITED BLOCK DIAGRAM WITH CASE STRUCTURE TO HANDLE ERROR IN FIGURE 19 RESULT CONSTANTS ARE IN RESULT PALETTE FIGURE 20 EXECUTE VI METHOD WHICH RETURNS A TEXT RESULT FIGURE 21 EXECUTE VI METHOD WHICH RETURNS A CHART RESULT FIGURE

Download Pdf Manuals

image

Related Search

Related Contents

MODE D`EMPLOI - G&G ARMAMENT  av-1200p user manual  MANUAL DE INSTRUCCIONES TLRI1985  GPS18185HR - User`s Manual - RTD Embedded Technologies, Inc.  Luna/200 Luna/275  BT 0850 Rethane FHB 658  

Copyright © All rights reserved.
Failed to retrieve file