Home
Smartphone & Cross-platform Communication Toolkit User Manual
Contents
1. 15 O Objects iDaqTask 12 13 15 19 20 23 25 Gee aane 12 13 optimizing OPUS rs 22 Parameters credentialFilePath 12 error Ollt SOHO nn 13 23 found boolean 14 R Requirements ADD ONS requirements 25 Minimum hardware requirements 10 Minimum software requirements 10 Mea 22 Server addres Sagittaria 13 Server password cu and res tton leni 13 Server pOll eee 13 TOOLS for SMART MINDS 40 tite ed or ee 18 20 Stop data communication 17 U Using a subset of analog channels 23 Ww While dOOD a elle 16 18 19 27 iDaq Development Guide Manual
2. SIGNAL FILTERING A PRACTICAL EXAMPLE The next diagram shows a sequence of packets sent by server to client when the latter uses the filterData vi function SERVER CLIENT FilterlD 0 Please need only 2 and 3 FilterID O channels FilterID 1 FilterID O FilterID 1 only 1 and 4 FilterID 1 channels FilterID 2 FilterID 1 FiGURE 23 SEQUENCE OF PACKET EXCHANGED BY SERVER AND CLIENT WITH FILTERDATA VI TOOLS for SMART MINDS 24 iDaq Development Guide Manual In this diagram the client calls for channels 2 and 3 and then for channels 1 and 4 FilterID allows the client to distinguish which packet with two waveforms actually contains signals either of channels 2 and 3 or of channels 1 and 4 25 CREATING ADD ONS FOR IDAQ This chapter explains how to develop useful ADD ONs fitting to all the needs thanks to iDaq DT in facts you can finally create personalized ADD ONSs for servers Using ADD ONs allows you to take advantage of certain functionalities indeed not developable through stand alone applications at all for example e Complete integration in iDaq interface e Inclusion of acquiring tasks into iDaq projects e Access to environment variables of iDaq server Creating an ADD ON requires a client satisfying particular requirements needed for a correct working of the entire server ADD ONS REQUIREMENTS This brief subchapter enlist
3. Bold italic 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 TOOLS for SMART MINDS 8 iDaq Development Guide Manual PREFACE iDaq Development Toolkit iDaq DT is a development toolkit to create standalone clients capable to connect servers and to create ADD ONs fully integrate into servers REQUIREMENTS In this section are listed requirements that users must have in order to install and use iDaq DT properly It is strongly recommended to
4. Developer Guide TOOLS for SMART MINDS 2 iDaq Development Guide 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 2012 TOOLS for SMART MINDS All rights reserved TOOLS for SMART MINDS 4 iDaq Development Guide Manual CONTENTS ABOUT THIS MANUAL CONVENTIONS PREFACE REQUIREMENTS MINIMUM HARDWARE REQUIREMENTS MINIMUM SOFTWARE REQUIREMENTS INSTALLATION GETTING STARTED WITH IDAQ DT CONNECTING WITH DATA SOURCE Essential connection parameters and functions Data source selection DISCONNECTING FROM DATA SERVER RECEIVING DATA Starting data communication Pausing data communication CREATION OF A SIMPLE APPLICATION STAND ALONE Creating the data displaying while loop Creating the event handler while loop ANALOG SIGNALS FILTERING Default data transmission Filtering process and functions Signal filtering a practical example CREATING ADD ONS FOR IDAQ ADD ONS requirements Getting started with ADD ONs development APPENDIX A USEFUL LINKS 10 10 10 10 11 12 12 12 13 15 16 16 17 18 19 20 22 22 23 24 26 26 27 34 FIGURE INDEX INDEX TOOLS for SMART MINDS 6 iDaq Development Guide Manual 36 39 ABOUT THIS MANUAL CONVENTIONS The following conventions appear in this manual
5. 23 FIGURE 22 DELEGATING FILTERID CONTROL TO IDAQTASK sens id e oran i ee 24 FIGURE 23 SEQUENCE OF PACKET EXCHANGED BY SERVER AND CLIENT WITH 24 FIGURE 25 CONNECT VI FUNCTION AND TASK CONTROL REPRESENTATION 5 5n oro nk opo nara Ska vo 27 FIGURE 23 CREATING MYFIRSTADDON PROJECT AND FILES etse 27 TOOLS for SMART MINDS 36 iDaq Development Guide Manual FIGURE 25 CONNECTING CONNECT VI WITH TWO WHILE LOOPS SAMPLE CODE scscecececececccsesccesescseseseseceseseseseeacs 28 FIGURE 26 ADDING PLAY PAUSE AND STOP BUTTONS TO THE PANEL erba se 29 FIGURE 28 CORRECT PLACEMENT OF READYFORDEALLOCATION VI 2 nennen nennen nennen nnn 30 FIGURE 29 CREATING A SECTION WITH ADD ON AND KEYS VALUES 31 FIGURE SO ADDSONICAUNCHER WINDOW dus aes durum ed Line Ue D 31 FIGURE SL EDITINGADD ONSEREDENTIALS nn Ne esse Tdv a 32 FIGURE 32 CONNECTION CREDENTIALS EDIT WINDOW Re Re i DR eth revu D 33 FIGURE SS EXECUTING ADD ON ESS li ohne ia eR pu o EO E 23 37 TOOLS for SMART MINDS 38
6. ADDING BUTTONS TO THE PANEL Now add three buttons to the panel play pause and stop then create the events that execute the play vi and terminate vi functions within the events handling structure as you can see in the next figure First While Loop Event management play Value Change FI First While Loop Event management File Edit View Project Operate Tools Window Help en sn Z fal 2 pause Value Change First While Loop Event management FIGURE 27 ADDING PLAY PAUSE AND STOP BUTTONS TO THE PANEL 29 STEP FOUR DISCONNECTION AND DEALLOCATION Remember that at the end of while cycles it is fundamental to set the disconnect vi and ReadyForDeallocation vi functions in order to allow iDaq to remove ADD ONs from memory in the right way After the execution of the ReadyForDeallocation vi function no other method be executed on Task object because from that point the ADD ON could be deallocated by iDaq If disconnect vi is not executed and ADD ON is stopped iDaq server is capable to recognize that the client is not more running and closes connection automatically Using disconnect vi is important to remove unused data structures and background tasks at client side The following figure illustrates the correct placing of the disconnect vi ReadyForDeallocation vi functions at the end of the while cycles The Error wire has been used to assure that both cycle
7. a data server Allow to select a data source among the available ones e Display the chart of the first available analog channel I 17 00 10 806 22 01 2013 sourceDescription lt DAQIMod2 FiGURE 14 SAMPLE APPLICATION OVERVIEW The complete source code of this project is available at the following link www toolsforsmartminds com The application is based on two loops 1 The first while loop waits for the analog data packets coming from the data source and displays the chart of the first analog channel among those available 2 The second loop has the task of handling events and therefore of interacting with users The user is provided with a Stop button to stop the client and a Change source button to select a data source The client at the startup of the process uses a file with connection credentials if this file isn t available it is possible to create a new one with these credentials NOTE Generally iDaq developers use the SCCT format for files containing connection credentials TOOLS for SMART MINDS 18 iDaq Development Guide Manual The following figure illustrates the code you have to use to upload the credential file to initialize the iDaqTask object and the server connection credentials SCCT FIGURE 15 SAMPLE CODE TO INITIALIZE IDAQTASK AND SERVER CONNECTION CREATING THE DATA DISPLAYING WHILE LOOP As just said before this first while loop has the task of interacting with
8. diagrams which show you how processes actually work CONNECTING WITH DATA SOURCE This chapter starts on explaining about how you can open a connection with data server the just mentioned data servers are instances of iDaq being run on local or remote machines First of all therefore you have to enable iDaq to open remote connections you can do it easily by clicking on the menu Options Data distribution In order to connect you must know connection credentials and data server IP address ESSENTIAL CONNECTION PARAMETERS AND FUNCTIONS iDaq DT is made up of a set of functionalities based on particular objects called DaqTask In order to be used iDaqTask objects hereinafter for the sake of brevity they are simply called Tasks need to be initialized through a specific function called startTask vi The next figure shows the LabVIEW code needed for opening connection with a server credentialsFileP ath Pa FiGURE 2 NECESSARY CODE FOR SERVER CONNECTION The credentialFilePath parameter you can see in the figure before serves the purpose of specifying the absolute path of the credential file you need to use The initialization of a credential file allows at the same time to verify its validity In case that credentialFilePath hasn t been specified StartTask vi demands users to create a new credential file and through a dedicated editor allows data server to verify the connection TOOLS for SMART MINDS 12 iDaq D
9. iDaq Development Guide Manual INDEX C Close COMME CUOMN ares 15 Connection credentials 12 Creating ADD ONs ADD ON Launcher 30 addon configuration INI file 30 addon configurator INI file 32 ADD ONS credentials cassia 31 LabVIEW project 30 Load INI from open projects button 32 MyFirstADDON library 26 ReadyForDeallocation vi 29 start as New Task button 32 D BO EEC mc 12 E Errors Server connection error 13 F Functions lt 14 Oil 13 14 26 GISCOMMECEVE em aironi 15 FilterData Vi minna 23 CSE AC P 26 5 19 25 39 Read 16 19 23 ReadyForDeallocation 27 29 20 cm m 14 sourceSelectionDialog vi 20 TT 12 terminate 20 iDaq user 22 M mono source
10. to allow iDaqTask to clear the allocated memory and to terminate background tasks 15 RECEIVING DATA After having explained all the details about how to open or close communications with data servers this chapter examines in depth the process of receiving data after that they have been sent from different data sources Within this chapter you will find how the entire receiving process has been built and learn about the functions iDaq DT gives you to achieve the best performances Client receives data through the Read streams vi function that includes the timing of the loop in which this function has to be integrated Read streams vi returns a packet of analog and digital data equipped of identification details of the data source from which it was generated The figure below shows a while loop in which packets concerning data streams are being real time extracted from the data source queue FIGURE 10 REAL TIME EXTRACTING PACKETS IN WHILE LOOP Data server configures conveniently its own routines according to the source selected by the client but it is also possible to change the data source selection in any moment during the server connection The client can change data source repeatedly during the connection STARTING DATA COMMUNICATION After having been specified the name of the source from which you want to receive data the client has to inform the server that it s ready to receive data In order to start data transmission from th
11. tool very useful during application debug In this paragraph are illustrated only main Launcher functionalities you can find more details in the ADD ON Launcher User Guide at www toolsforsmartminds com no project Load INI from open projects Load INI Task Credentials Environment Addon ini pates Gm New Task Editor Gm Existing Task Editor error out status code Run as Reentrant s fo source Start as Loaded task d Save Task Close Task userData Task data not present J FicuRE 30 ADD ON LAUNCHER WINDOW 31 If you haven t a credential file available to connect the ADD ON to iDaq use the Credential gt Edit button and type in either IP Address or the name of the PC where iDaq is executing port and authentication password It is possible to change the values used by iDaq Port 9000 Password iDaq through the iDaq s menu Configuration gt Options Data Distribution tab but look at the User manual for more information you can find the link in the APPENDIX A table T The next image represents how to get Credentials without Credential files available no project Load INI from open projects Load INI Environment Addonini Credentials File Path C iDag Credentials SCCT FIGURE 31 EDITING ADD ONS CREDENTIALS The example just mentioned uses the same iDaq credential file in the c iDaq fol
12. 5 rain 15 FIGURE 10 REAL TIME EXTRACTING PACKETS IN WHILE LOOP esses sess e essere ssa ese 16 FIGURE 11 STARTING DATA SOURCE TRANSMISSION WITH PLAY 22 LEY FEES a 17 FIGURE 12 STOPPING DATA SOURCE TRANSMISSION WITH 5 2 ese esses 17 FIGURE 12 DATA TRANSMISSION PROCESS FROM DATA SOURCE TO cesses 17 FIGURE 14 SAMPEE APPLICATION OVERVIEW ci nana nana scene da cena son 18 FIGURE 15 SAMPLE CODE TO INITIALIZE IDAQTASK AND SERVER CONNECTION 19 FIGURE 16 DATA ACQUISITION WHILE OOP semer 19 FIGURE 17 SAMPLE CODE OF AN EVENT HANDLING STOP BUTTON 1 1 11 4 4 20 FIGURE 18 SAMPLE CODE OF AN EVENT HANDLING SOURCE SELECTION csccscoscsscsvceccscossassusceccscsssessuccecessasserseccscesss 20 FIGURE 19 RESULTING CODE OF A SAMPLE STAND ALONE nun 21 FIGURE 20 SERVER CLIENT DATA TRANSMISSION PROCESS DIAGRAM 1 22 FIGURE 21 SAMPLE CODE FOR FILTERDATA VI IMPLEMENTATION cia
13. L EEEEE e e ees NOTE All the functions explained in this chapter are fundamental for all those who develop applications intended to be used in locations equipped with low bandwidth communication channel for example Wi Fi connections and some types of internet connections DEFAULT DATA TRANSMISSION Data transmission process from server to a client is precisely described by the next diagram iDaq server I have 3 devices with the following signals Time Notice that client receives a forth package from Dev2 which has been sent before the server Please send me data from Dev1 veces message from client 1 x Represents n array of analog waveforms and a 2D array of digital lines if available FiGURE 20 SERVER CLIENT DATA TRANSMISSION PROCESS DIAGRAM By default iDaq server sends to every channel of the selected data source If you want to configure a source we suggest you to take a look at the iDaq user manual you can find its link in the Appendix A useful links at the end of this manual TOOLS for SMART MINDS 22 iDaq Development Guide Manual FILTERING PROCESS AND FUNCTIONS When a client needs to use a specific subset of the analog channels available in data source it is possible to require the server to send only those selected channels MEET EXAMPLE e data source has available 16 analog channels e Aclient has to use for a specific acti
14. Manual To select data source you can use the function SourceSelectionDialog vi which provides user with a list of all the available data sources and their characteristics and which automatically make the selection SourceSelectionDialog vi allows you to select one or more sources In the following figure you can see a sample code for source selection and the corresponding dialog box i Source Selection Dialog 73 Available Source List Device Product Type SIN Location Additional info cDAQ1Mac NI 9205 Simulated placed into cDAQ1 slot 1 cDAQ od2 NI 3205 Simulated placed into cDAQ1 slot 2 Description of more sources Y Pressure trasducers are connected here Esc Cancel FIGURE 8 SOURCE SELECTION SAMPLE CODE AND DIALOG BOX This chapter goes on explaining about the matter of data servers connection it analyzes in particular how to close communication with data servers gives useful indications about the functions iDaq DT uses and how to handle them In order to disconnect from a data server implement the disconnect function as indicated in the next example FIGURE 9 DISCONNECT FUNCTION NOTE If a client closes communication without having been disconnected before with disconnect vi the server can determine anyway if that client isn t connected anymore and therefore automatically closes the connection It s a good rule however to use disconnect vi command at the end of every connection in order
15. ON has been terminated by a user through the isTerminated method p nr STEP TWO CONNECTING TASK WITH TWO WHILE LOOPS Connect the wire of task object with two while loops the first one for events handling the second one for data received displaying Both while loops end when the isTerminated vi function returns TRUE It is not necessary to use this programming scheme but it is fundamental that when isTerminated vi function returns a TRUE value all of the active loops in an ADD ON end That is the only way in which iDaq can handle the different types of ADD ONs contained in the iDaq work projects If you want more details about iDaq work projects we suggest you to take a look at the iDaq user manual at http www toolsforsmartminds com pdf iDaq 20User 20Manual pdf In the following figure it is represented the resulting code as described before First While Loop Event management EM 0 Timeout 7 2 task 587 c o The 2 while loop contains Second While Loop ReadyForDeallocation function and it is the 50 E necessary code part to visualize the chart of the first analogWaveforms a 0 Waveform Chart analog channel FIGURE 26 CoNNECTING CONNECT VI WITH TWO WHILE LOOPS SAMPLE CODE TOOLS for SMART MINDS 28 iDaq Development Guide Manual STEP THREE
16. artminds com pdf SCCT 20User 20Manual pdf user manual Look up here for iDaq http www toolsforsmartminds com pdf iDaq 20User 20Manual pdf user manual Look up here for stand www toolsforsmartminds com alone application sample code Look up here for ADD ON sample code www toolsforsmartminds com TOOLS for SMART MINDS 34 iDaq Development Guide Manual 35 FIGURE INDEX FIGURE 1 IDAQ DT INFORMATION PACKAGE DURING GUIDED 5 nne nun 11 FIGURE 2 NECESSARY CODE FOR SERVER 522 gesenkt ise pusib b DUE ae 12 FIGURE 3 CONNECTION PARAMETERS EDITOR iba tk ein ex come menu soso ER Ta xor uy 13 FIGURE 4 CONNECTING IDAOTASK WITH 252505 13 FIGURE 5 GETTING DATA SOURCE INFORMATION WITH READ SOURCELIST VI FUNCTION 14 FIGURE 7 5 5 Ollio 14 FIGURE 5 ELABORATING CLUSTER WHEN BOOLEAN FOUND nnne rire sess 14 FIGURES DISCONNECT FUNCTION Praten 15 FIGURE 7 SOURCE SELECTION SAMPLE CODE AND DIALOG BOX a 25
17. ata view and one for freeze frame The complete project is available at the following URL www toolsforsmartminds com STEP ONE STARTING PROGRAMMING ADD ONS First of all launch LabVIEW and create a new project named MyFirstADDON in the same way in this project create a LabVIEW library and name it MyFirstADDON In the next image it is illustrated the project content and the files hierarchy interface vi MyFirstADDON aliases S E Project MyFirstADDON Ivproj 3 MyFirstADDON lvlib S My Computer i T 3 MyFirstADDON lvlib __ MyFirstADDON lvlps WE interface vi MyFirstADDON lvproj F Dependencies 2 Build Specifications FIGURE 24 CREATING MYFIRSTADDON PROJECT AND FILES HIERARCHY Now create a new vi file in the MyFirstADDON library and name it interface vi Combining LabVIEW palette with iDaq DT functions allows you to prepare the Connect vi function to which it has to be connected a control named task The next figure represents punctually the connection between them task OBI pn FIGURE 25 CONNECT VI FUNCTION AND TASK CONTROL REPRESENTATION 27 on NOTE ADD ONs MUST contain an iDaqTask object named task because iDaq needs it to interact with all the executing ADD ON5s The initialization of this object is made by before ADD ON execution iDaq makes use iDaqTask objects to terminate all of the executing ADD ONs through the terminate vi method and can understand whether the ADD
18. ce it is a VIP package first you need to download VIP Manager from JKI You can download a free copy at https lumen ni com nicif us evaltlktvipm content xhtml Once you have downloaded VIP Manager you can proceed with iDaq DT installation You can find it at www toolsforsmartminds com products programmable data logger php Select an action to perform on the package Product Homepage 1329044 2 iDaq Development Toolkit Development Toolkit v1 5 3 60 by TOOLS for SMART MINDS Author Claudio Vivante om Copyright Copyright c 2013 TOOLS for SMART MINDS pa Show in Palettes License Custom Compatible LabVIEW Versions gt 2011 Compatible OS Versions Windows i Show Examples Description iDaq Development Toolkit lets you create standalone clients and addons for iDaq datalogger This Package depends on these other packages smartphone_ amp _crossplatform_communication_toolkit gt 2 6 3 276 FIGURE 1 IDAQ DT INFORMATION PACKAGE DURING GUIDED INSTALLATION 11 GETTING STARTED WITH IDAQ DT This chapters introduce you to the main features of iDaq DT and on how much their implementation can be useful and high performing once matched with iDaq and SCCT Since the purpose of this manual is leading and supporting you step by step through iDaq DT functionalities in the simplest way every chapter provides you with a brief introduction accurate indications and useful images and
19. check them out before starting iDaq DT installation MINIMUM HARDWARE REQUIREMENTS Ensure that your computer fulfill the following hardware requirements e Dual core CPU or higher 2GBRAM 4 GB is strongly recommended e Display resolution 1024x768 or higher 200 MB free space on disk required by iDaq e about 800 MB free space on disk required by National Instruments device drivers e mouse or other pointing device MINIMUM SOFTWARE REQUIREMENTS Ensure that your computer fulfill the following software requirements e 05 Windows XP SP3 or higher e National Instruments device drivers rel 9 3 x or higher You can download a free copy of the proper device driver for your acquisition device at www ni com e LabVIEW 2011 to create Standalone applications e LabVIEW 2012 to create both Standalone applications and ADD ONs for iDaq e SCCT Smart phone amp Cross platform Communication Toolkit for LabVIEW 2 6 x version or higher downloadable at http www toolsforsmartminds com products SCCT php If you need any information about SCCT you can find it in its user manual available at http www toolsforsmartminds com pdf SCCT 20User 20Manual pdf e you can find out all the information about iDaq installation in its user manual available at http www toolsforsmartminds com pdf iDaq9620User9620Manual pdf TOOLS for SMART MINDS 10 iDaq Development Guide Manual INSTALLATION In order to install iDag DT sin
20. der The next image illustrates the connection credentials window TOOLS for SMART MINDS 32 iDaq Development Guide Manual Server address localhost Server port 9000 OK Server password Set password Esc Cancel FIGURE 32 CONNECTION CREDENTIALS EDIT WINDOW When you are sure that the credentials file allows to connect with click on the Load INI from open projects button so that Launcher transfer data in the addon configurator INI file created before Click on the start as New Task button and the just created vi start being executed as the next image shows AM F stADDON Ivlib inter File Edit View Project Operate Tools Window Help 0 1 0 05 0 0 05 01 0 15 0 2 01 14 40 327 01 14 45 327 01 02 2013 01 02 2013 3 1 lt FIGURE 33 EXECUTING ADD ON 33 APPENDIX A USEFUL LINKS In this appendix we make a quick resuming list of the most useful links you have to look up to get the best results from iDaq DT About links For any information or www toolsforsmartminds com support about iDaq www toolsforsmartminds com products programmable data logger ph Download here iDaq DT Download here VIP https lumen ni com nicif us evaltiktvipm content xhtml manager Download here the WWW nl com drivers for NI devices http www toolsforsmartminds com products SCCT ph Download here SCCT Look up here for SCCT http www toolsforsm
21. e source you can use the play vi function as shown in the following figure TOOLS for SMART MINDS 16 iDaq Development Guide Manual a FIGURE 11 STARTING DATA SOURCE TRANSMISSION WITH PLAY VI PAUSING DATA COMMUNICATION When you have received all the data you need you can temporarily stop data communication from server side using the pause vi function as explained in the next figure FiGURE 12 STOPPING DATA SOURCE TRANSMISSION WITH PAUSE VI The client can pause and restart data transmission again and again until server is connected When the client uses the pause vi command the server automatically rejects the not sent data packets therefore the client can t receive them after having restarted data communication The next diagram explains the data transmission sequence between server and client Data source acquisition system pps 001 gp i d dg SERVER x x x x x TY TY CLIENT I gt Represents a data package that the server acquires from data source X Source Selection FIGURE 13 DATA TRANSMISSION PROCESS FROM DATA SOURCE TO CLIENT CREATION OF A SIMPLE APPLICATION STAND ALONE This chapter will guide you step by step in the creation of a sample basic application that you can easily realize thanks to iDaq Development Toolkit The application is programmed to have the following features e Establish a connection with
22. evelopment Guide Manual The next figure shows the connection parameters editor Connection parameters editor Server address localhost Server port 9000 OK Server password Set password Esc Cancel FIGURE 3 CONNECTION PARAMETERS EDITOR The following list resumes and specifies the credential values needed to open a new connection e Server address localhost e Server port 9000 e Server password You can verify if the credentials you ve typed in are actually right for the data server by means of the Test button then click on OK button to save connection parameters Once iDaqTask object has been initialized you can finally open the communication with data server In order to connect iDaqTask object apply connect vi function as suggested in the next figure nl FIGURE 4 CONNECTING IDAQTASK WITH CONNECT VI If data server is either not found or not accessible or used credentials have been rejected connect vi returns an error You can easily identify what kind of error is it by implementing the error out source parameter DATA SOURCE SELECTION When connection has been successfully established data server transmits immediately information about all the available acquisition devices e g data sources in order to handle in the best way the communication In facts if for example server data sources turn out to be dynamic that is they change as time passes by the server updates data abo
23. lar procedure of private data handling that doesn t require local variables applying This is the reason why the implementation of the selectSourceDialog vi function actually doesn t refresh the Task object after the execution of sourceSelectionDialog vi function The next image exemplifies the code needed to create a source selection event PRE RE RE RE ER RE RE RE RE AX e RE RE RE RE RE RS analogWaveforms Bee Fee Ree Bee Ne Bee Fee Ben O OOOO OOOO OOOO OOOO Ben Ben Fee Fee Fee Ben Be Ie LL IOS FiGURE 18 SAMPLE CODE OF EVENT HANDLING SOURCE SELECTION TOOLS for SMART MINDS 20 iDaq Development Guide Manual It is very important at the end of the data displaying loop to use the disconnect vi function in order to advise the server that the connection has been closed and to remove data used by iDaq DT from the memory In the next figure you can finally see the resulting application diagram cedens SCCTI FiGURE 19 RESULTING CODE OF A SAMPLE STAND ALONE APPLICATION 21 ANALOG SIGNALS FILTERING This chapter describes the advanced iDaq DT functions that allow to optimize CPU use as regards the client and to greatly reduce band wasting of the communication channel A AS AAAL ZALZZLLLItninLLLLLLlDlDl izL CKLLLLLLAALLLLIIL
24. s are ended Notice that task object doesn t need to be updated at the end of the while cycles First While Loop Event management Ze 3 stop Value Change task E d Waveform Chart ue ET i FIGURE 28 CORRECT PLACEMENT OF READYFORDEALLOCATION VI FUNCTION TOOLS for SMART MINDS 30 iDaq Development Guide Manual STEP FIVE TESTING CODE At this point if you want to test the just created sample code you can do it in the next way e Launch on PC easily reachable from the computer you have used to create the code as main hypothesis of the following paragraphs iDaq is supposed to be executing on the same computer in which LabVIEW has been used Verify the presence of at least one active data source in iDaq In the project folder create a text file named addon configuration INI in which a section has to be created with the ADD ON name and the keys values within it indicated in the next figure My First ADD ON interfacerileName interface vi libraryFileName MyFirstADDON FIGURE 29 CREATING A SECTION WITH ADD ON NAME AND KEYS VALUES This file has to be saved in the same folder in which the LabVIEW project file lvproj is placed e From LabVIEW now select Menu Tool T4SM gt iDaq DT ADD ON Launcher ADD ON launcher pops up from now on this manual calls it Launcher for simplicity s sake and allows to simulate iDaq s functionalities within LabVIEW Launcher is a practical
25. s the requirements being fundamental to create ADD ONs check them before starting e The panel must be set with window behavior floating eventual subpanels requiring data inputs by the user can be created through window behavior modal e Clients can t have splash pages e Clients can t have windows behavior modal at the start up of user input panels e Clients must use isTerminated vi function to end the execution indeed in order to allow iDaq to close clients properly e Clients are not enabled to ask user confirm before termination if isTerminated vi returns TRUE value e Taskobject can t be initialized by clients this function is supposed to be a server task e The client must contain an iDaqTask control named task As regards software requirements the following list resumes the fundamental ones e iDaqfor Windows 1 0 9 x or higher e LabVIEW 2012 e SCCT 2 6 x or higher iDaq DT 1 1 x or higher TOOLS for SMART MINDS 26 iDaq Development Guide Manual GETTING STARTED WITH ADD ONS DEVELOPMENT This chapter describes the necessary steps to develop your own ADD ON In particular this paragraph explains about how to create a plug in that in the end succeed in having the following features e Reading in a chart all the data coming from the first analog channel available from a selected data source e Enabling therefore to select a chosen data source among those available e Having two buttons for d
26. user and contains the following events stop Value change and changeSource Value change In the image that follows you can see that there are being used two functions of iDaq DT 1 Read Streams vi togetthe next data packet and display the first analog signal 2 isTerminated vi itreturns TRUE when the Task has been terminated FiGURE 16 DATA ACQUISITION WHILE LOOP NOTE There are many ways to end the loops of a LabVIEW applications and every developer chooses its own favorite For iDaq DT applications it s suggested to use isTerminated vi and isTerminated vi functions to verify the task status and to end the activities regarding connections with the iDaq server pr si 19 CREATING THE EVENT HANDLER WHILE LOOP The second while loop which is the event handler is made up of the classical LabVIEW structure for event handling and mainly it handles two events 1 The first event linked to the stop button is necessary to stop the data visualization loop described before The terminate vi function closes all the activities managed by the Task object The following image resumes how the event handling stop button works Z 0 stop Value Change vb FIGURE 17 SAMPLE CODE OF AN EVENT HANDLING STOP BUTTON 2 The second event handles the source selection iDagTask object has a particu
27. ut available sources characteristics Getting information about the available data sources is very easy you simply have to implement the Read sourceList vi function as explained in the following figure 13 sourceList available sources nmm FIGURE 5 GETTING DATA SOURCE INFORMATION W ITH READ SOURCELIST VI FUNCTION In order to get instead the available data sources characteristics use the Read signalTable vi function Every data source is described by a cluster and Read signalTable vi actually returns an array of clusters which allows you to get all the details you need NOTE Remember to elaborate cluster data only when the Boolean index found returns a TRUE value as indicated in the next figure FIGURE 6 ELABORATING CLUSTER WHEN BOOLEAN FOUND TRUE connect vi function picks automatically the first data source available if no data source has been selected before If you want to connects to different sources use Changesource vi An iDaq task can be connected to one or more data sources After sources are changes iDaq sends all data acquired from selected sources to your task In the following figure an example in which two sources Dev2 e Dev5 are being selected is shown i Dev2 Dev5 FiGURE 7 DATA SOURCE SELECTION yn Use the comma character to separate the selected sources names TOOLS for SMART MINDS 14 iDaq Development Guide
28. vity only channels 2 3 7 and 11 The client can require the server to send only the needed analog channels waveforms thanks to the filterData vi function The next figure represents how to implement this channel selecting function filterld FIGURE 21 SAMPLE CODE FOR FILTERDATA VI IMPLEMENTATION filterData vi function returns a number called FilterlD This number identifies the filtering request just sent to the server and it increases at every following request of channel selection by client Read streams vi function returns ID number of the applied filter by data server to each sent data packet Comparing the ID number returned by Read streams vi with the ID number returned by filterData vi is fundamental to identify the signals coming from server accurately A different Filterld is generated for every filter request When a new filtering operation is performed FilterlD is incremented The FilterlD permits the client to relate every received data package to the relative filter request Filterld is fundamental to process received data in the right way It is also possible to delegate the control of FilterID to iDaqTask object so that only the iDaq packets provided with corresponding FilterID can be accepted If you want to give iDaqTask the duty of handling filters you simply have to use the matchFilter vi function with parameter TRUE as indicated in the next figure 23 FIGURE 22 DELEGATING FILTERID CONTROL TO IDAQTASK
Download Pdf Manuals
Related Search
Related Contents
2 - Sony NDG8022(WW) ( 施工説明 ) BEDIENUNGSANLEITUNG Zion BUBBLEXTM troubleshooting Bedienungsanleitung Digitaler Satelliten Receiver - AHG 医療関連企業のポートアイランドへの進出について Ayuda de Adobe Acrobat Reader 5.1 ナックルプロテクタ䊷 (STD / RACING) 取扱説明書 Copyright © All rights reserved.
Failed to retrieve file