Best way to control and read data from multiple instruments?

Hello,
I'm building an application to test power supplies involving multiple pieces of equipment over a couple of different comm busses. The application will also send control instructions to some of the instruments, and read data from some of the instruments. The reading and control profiles will not run on the same schedule (variable length control steps, configurable read interval).
I was thinking of using a queued statemachine (producer/consumer) for the control profile and another to read the data, but I got concerned that there would be collisions between sending control commands and read commands to the same machine. Is there a suggested design pattern for implementing something like this?
Timing of the commands isn't critical down to the milisecond, but I need to collect reasonably accurate timestamps when the data is read. The same is true for the control commands.
Here are the instruments I'm going to use, if the are control, read, or both, and the communication method
Instrument Funtions Comm Method
Power Supply Read data Communicates to PMBus Adapter
PMBus to USB Adapter Read data USB (Non-Visa)
Switch control relays USB (VISA)
Power Dist. Unit read data/control outlets SNMP (Ethernet)
Electronic Load read data/control load GPIB (VISA)
Thermal Chamber read data/control temp Ethernet (VISA)
Thanks,
Simon

Hello, there is a template in LV called "Continuous measurement and Logging".
It can give you some idea how to properly decouple the "GUI Event handler" top loop (where your Event structure is) from the DAQ and other loops.
You do not need to totally replicate the above example, but you can find there nice tricks which can help you at certain points.
The second loop from the top is the "UI message loop". It handles the commands coming from the top loop, and regarding to the local state machine and other possible conditions and states, it can command the other loops below.
During normal run, the different instrument loops just do the data reading, but if you send a control command from the top loop to a certain instrument loop (use a separate Queue for every instrument loops), that loop will Dequeue the control command, execute it, and goes back to data reading mode (in data reading mode the loop Dequeu itself with a "data read" command automatically). In this way the control and data read modes happen in serial not in parallel which you want to avoid (but I think some instrument drivers can even handle parallel access, it will not happen in really parallel...).
In every instrument loop when you read a value, attach a TimeStamp to it, and send this timestamp/value couple to the DataLogging loop via a Queue. You can use a cluster including 3 items: Source(instrument)/timestamp/value. All the instrument loops can use the same "Data logging" Queue. In the Datalogging while loop, after Dequeue-ing, you can Unbundle the cluster and save the timestamp and data-value into the required channel (different channel for every instrument) of a TDMS file.
(Important: NEVER use 2 Event structures in the same top level "main" VI!)

Similar Messages

  • Best way to browse and read data from a lot of files?

    Hi All,
    I am trying to read tags from music files. Currently I'm listing all the files and then reading through the tags, as below:
    List<File> result = new ArrayList<File>();
    FilenameFilter mp3filter = new FilenameFilter() {
         public boolean accept(File dir, String name) {
              return name.endsWith(".mp3");
    FilenameFilter wmafilter = new FilenameFilter() {
         public boolean accept(File dir, String name) {
              return name.endsWith(".wma");
    FileFilter dirFilter = new FileFilter() {
         public boolean accept(File file) {
              return file.isDirectory();
    File[] dirList = aStartingDir.listFiles(dirFilter);
    File[] mp3files = aStartingDir.listFiles(mp3filter);
    File[] wmafiles = aStartingDir.listFiles(wmafilter);
    List<File> filesDirs = Arrays.asList(dirList);
    List<File> filesMp3 = Arrays.asList(mp3files);
    List<File> filesWma = Arrays.asList(wmafiles);
    for (File file : filesMp3) {
         result.add(file);
    for (File file : filesWma) {
         result.add(file);
    for (File file : filesDirs) {
         List<File> deeperList = getFileListing(file);
         result.addAll(deeperList);
    }and then read the files in a for loop through the list.
    Is there a better way to do the same?

    Well, you could optimize that just a little bit by only calling listFiles once with a filter that would accept directories, wmas, and mp3s all in one go. Then you could iterate through the results and separate them into the three categories after you had the complete recursive directory listing. That may be faster. But your OS will likely cache the results of the directory listing, thus minimizing the effort of your current approach. But honestly, no... you need the headers from every file, so you'll need to find each file and then check the headers.
    If you want, you can cache the results somewhere for future reference. Are you concerned about performance or some such?

  • Can you suggest a best way to store and read arabic from oracle database?

    Hi ,
    can you suggest a best way to store and read arabic from oracle database?
    My oracle database is Oracle Database 10g Release 10.1.0.5.0 - 64bit Production on unix HP-UX ia64.
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CHARACTERSET WE8ISO8859P1
    I have presently stored the data in nvarchar2 field. But i am not able to display it correctly.

    Using the national characterset should work but there are other factors that you have to consider when working with NCHAR/NVARCHAR2/NCLOB.
    If possible, changing the characterset is usually the best solution if it's a possiblity for you.
    For more info:
    Dear Gurus: Can u pls explain the difference between VARCHAR2 & NVARCHAR2??

  • Best way to export and import data from an iPhone app?

    How do people here prefer to export and import data from an iPhone app?
    For example, suppose your app creates or modifies a plist. It might be nice to provide that plist to the user for separate backup and later allow them to re-import it.
    How do people do that? Email the plist to an address? If so, how would one later get it back in?
    Is there a common way people do this kind of thing?
    Thanks,
    doug

    Or maybe the best approach for this is some sort of file synchronization feature? Is there a way of having files from the app's filesystem automatically get stored on the computer's filesystem when synchronizing and vice-versa?
    doug

  • What is the best way to load and convert data from a flat file?

    Hi,
    I want to load data from a flat file, convert dates, numbers and some fields with custom logic (e.g. 0,1 into N,Y) to the correct format.
    The rows where all to_number, to_date and custom conversions succeed should go into table STG_OK. If some conversion fails (due to an illegal format in the flat file), those rows (where the conversion raises some exception) should go into table STG_ERR.
    What is the best and easiest way to archive this?
    Thanks,
    Carsten.

    Hi,
    thanks for your answers so far!
    I gave them a thought and came up with two different alternatives:
    Alternative 1
    I load the data from the flat file into a staging table using sqlldr. I convert the data to the target format using sqlldr expressions.
    The columns of the staging table have the target format (date, number).
    The rows that cannot be loaded go into a bad file. I manually load the data from the bad file (without any conversion) into the error table.
    Alternative 2
    The columns of the staging table are all of type varchar2 regardless of the target format.
    I define data rules for all columns that require a later conversion.
    I load the data from the flat file into the staging table using external table or sqlldr without any data conversion.
    The rows that cannot be loaded go automatically into the error table.
    When I read the data from the staging table, I can safely convert it since it is already checked by the rules.
    What I dislike in alternative 1 is that I manually have to create a second file and a second mapping (ok, I can automate this using OMB*Plus).
    Further, I would prefer using expressions in the mapping for converting the data.
    What I dislike in alternative 2 is that I have to create a data rule and a conversion expression and then keep the data rule and the conversion expression in sync (in case of changes of the file format).
    I also would prefer to have the data in the staging table in the target format. Well, I might load it into a second staging table with columns having the target format. But that's another mapping and a lot of i/o.
    As far as I know I need the data quality option for using data rules, is that true?
    Is there another alternative without any of these drawbacks?
    Otherwise I think I will go for alternative 1.
    Thanks,
    Carsten.

  • What is the Best way To Copy and paste data from 1 book to another

     I have 18 sheets in 5 different books that I want to extract data from specific cells.  What is the best way to do this?  Example:  1 sheet is called Numbers E-O1 data in 13:WXYZ. The data updates and moves up 1 row every time I enter
    a new number. So let's say I enter the number 12. Through a lot of calculations the output goes in 13:WXYZ. To what I call a counter which is a 4 digit number.  Anyways, how can I send that 4 digit number to a totally different sheet?  To bullet
    what I'm talking about
    data in cells Row 13:WXYZ in book called Numbers sheet E-O1
    send data to book called "Vortex Numbers" Sheet E-O row 2001:CDEF
    What formula or Macro can I use to make this work?
    thank you!

    Hello Larbec,
    Syntax:
    '[BookName]SheetName'!Range
    Enter in cell  2001:CDEF:
    ='[Numbers]E-O1'!13:WXYZ
    This assumes that the file is open in Excel. Otherwise you need to add the path:
    'ThePath[BookName]SheetName'!Range
    Best regards George

  • Read data from multiple sheets

    Hi,
    Can anyone tell me how to read data from multiple excel sheets?
    Thanks.

    Hi,
    go through this link this may help u.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/readmultiplesheetsofanExcelfileintoSAPthroughABAP&focusedCommentId=92930268
    Thanks
    Edited by: tarangini katta on Apr 23, 2009 2:34 PM

  • Trouble reading data from GPIB instrument using VISA

    Hello, I am having trouble with reading data from a GPIB instrument in LabVIEW. It appears that the data that is returned from VISA read is incorrect. (I used NI Spy to verify what it should be and what I get, they are different) The odd thing is that when I use the VISA interactive control utility to get the data, it works perfectly. Is there some sort of VISA property that I need to set to get it to work right? Writing to the device seems to work correctly. If you need more info, please e-mail me @ [email protected] Thanks in advance!

    What exactly do you mean when you say the data you are getting is incorrect? I'm guessing that you are dealing with some sort of data type issue. The VISA Read VI will return a set number of bytes in string (ASCII) format. If you are expecting a different data type, you will have to do some conversion by either using a type cast or string conversion function. The type cast function can be found in the Advanced-> Data Manipulation palette, while the string conversion functions can be found in the String palette.

  • The best way to deploy and redploy of a multiple SOA application

    Hi all,
    I'm looking for the best way to deploy and redeploy a multiple SOA application.
    1) The multiple SOA application contains many projects. Some projects depend on another projects.
    2) WebLogic is in productive mode.
    I wound like automaticly deploy and redeploy my multiple SOA application.
    Does anyone have any experience of this?
    Many thanks
    PG

    We use ant scripts to automatically deploy and redeploy multiple composites.
    The ant scripts gets shipped along with the SOA installation. The ant script that is used for the deployment is:
    ${oracle.home}/bin/ant-sca-deploy.xml
    You can also use the same for your deployment.

  • Best way to control and run multiple (up to 20) processes independantly in LV

    Hi all, 
    I'm trying to build an application in LV to independantly control and run multiple (up to 20) processes, ie, it should be able to start and stop any of the processes at any given time. What would the best way to code for this? Off the top of my head would be to use a unique notifier to control each of the process, but I'm thinking that the code upkeep may be a handful with this number of notifiers being defined. Are there better ways of doing this?
    Appreciate any help and insight on this.Thanks a bunch in advance!
    Solved!
    Go to Solution.

    I forgot some more important questions:
    How large is your development group?
    How much "discipline" do you want to program into the Process Commands framework? For instance, is it OK for any VI to command a process into a certain state, or should your program generate a broken wire or run-time error if a command is sent from a non-authorized source?
    Where do your needs fall on this spectrum: simplicity that gets the job done and the product out the door and will probably not need much maintenance or upgrading, or flexible framework that will likely undergo multiple upgrades or fall into the hands of multiple developers?
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • The best way to move 2TB of data from Win to Mac

    Hello,
    what is the best way me to move 2TB (multiple files) data from windows to Mac?
    I think that over the LAN, even using crossover cable connecting 1GB NICs would be painfully long. (Windows disk is quite fragmented)
    If I put windows (ntfs partitioned) disc to one of Mac Pro bays, will Mac allows me to access the date on it?
    if I take the disk of the windows PC and put it to [eSATA Hard Drive docking solution|http://eshop.macsales.com/item/Newer%20Technology/FWU2ES2HDK>, will Mac be able to mount it and let me copy the files from the windows disk?
    Any other ways of moving 2TB data from windows to Mac?

    Being able to read, also means, being able to mount said drive volumes.
    Windows 7 64-bit (Pro version if you have dual processor, which at this time really isn't needed that much) would work fine too.
    There are programs, some or most have their own limitations, allow Windows to read and write to Mac HFS+ file system volumes; or the reverse and allow Mac OS to read/write NTFS. None are what I call perfect.
    Becuase of limitations in older file systems and partitioning, Apple and Microsoft have implemented support for volumes larger than 2TB with GPT to replace aging Master Boot Record (Windows 7 even can't run off MBR with volumes larger than 1.9TB). Mac Pro uses GPT and can boot from very large volumes.
    eSATA docking stations. Depends on the interface and controller card if any, whether using SATA PCIe for one thing (you would not ever want to use USB though maybe USB3 PCIe if you can find one), therefore, use internal drive bays. Also, more concern with the drive temperature in one, they can get very warm in my experience.
    But maybe you do, maybe you don't, actually need to move data, maybe just have it read-only accessible.
    Putting the drive in a FW800 case would probably make the most sense, both now and for further use for booting (backup clones are handy and allowed) or for backup with Mac TimeMachine.
    But I would install Windows 7 on your Mac Pro. I use GPT for data drives in Windows and to read from in Mac OS environment.

  • Best way to get and pass filename from a DB Table to SQL Loader?

    What is the best way to get the data filename from an Oracle Table to pass it to SQL Loader?

    I am looking for a sompler way.
    I only want to instruct SQL Loader/Control file to get the filename from a table. Do we need external tables for this? Can I pass a funciton/SQL as parameter to filename?
    Thanks

  • What is the best way to import and export footage from the 5D Mark II?

    Hello,
    I've just finished shooting what I am considering to be my directorial masterpiece.  Shot it on the Canon 5D (1080p, 24fps), and the footage looks amazing.  Now I am ready to start editing and have been using premiere lately, but I have yet to figure out the proper pipeline.  I want to know the best way to retain resolution before I delve into this project.
    My questions:
    1)  What is the best way to start a new project and import the footage without having to render whilst editing, so as to retain all resolution and originality of the source footage?
    2)  What is the best way/ codec/ format to export this same footage once editing is complete so as to retain that crisp 1080p for which the 5D is so recognized?
    3)  What is the best way/ codec/ format to import and export/ render between premiere and after effects?  I am speaking mostly of vfx and color correction.  I also have some 30fps footage that I intend to slow down in AE and then import into premiere.
    I know this is pretty broad, but as a solo filmmaker I really need someone's guidance.  I rarely ever finish my films with the same, crisp look as the footage.  I need pipeline help, and really appreciate it!

    ascreenwriter wrote:
    Hello,
    I've just finished shooting what I am considering to be my directorial masterpiece.  Shot it on the Canon 5D (1080p, 24fps), and the footage looks amazing.  Now I am ready to start editing and have been using premiere lately, but I have yet to figure out the proper pipeline.  I want to know the best way to retain resolution before I delve into this project.
    My questions:
    1)  What is the best way to start a new project and import the footage without having to render whilst editing, so as to retain all resolution and originality of the source footage?
    2)  What is the best way/ codec/ format to export this same footage once editing is complete so as to retain that crisp 1080p for which the 5D is so recognized?
    3)  What is the best way/ codec/ format to import and export/ render between premiere and after effects?  I am speaking mostly of vfx and color correction.  I also have some 30fps footage that I intend to slow down in AE and then import into premiere.
    I know this is pretty broad, but as a solo filmmaker I really need someone's guidance.  I rarely ever finish my films with the same, crisp look as the footage.  I need pipeline help, and really appreciate it!
    1. Follow the advice above. Also use the Media Browser to import the footage in case you have spanned media files. Import files with the Media Browser.
    2. It largely depends on what you wish to ouput to: Blu-ray, web, etc. This FAQ gives the best answer: What are the best export settings?
    3. Use the Replace with Adobe After Effects Composition function.

  • How to read data from multiple files and append in columns in one file

    Hi Guys,
    I have a problem in appending data from files in different columns. I have attachement has file A and B which I am reading and not able to get data as in file Result.txt. Please comment on how can I do this
    Solved!
    Go to Solution.
    Attachments:
    Write to file.vi ‏13 KB
    A.txt.txt ‏1 KB
    B.txt.txt ‏1 KB

    You cannot append columns to an existing file. Since the data is arrange line-by-line as one long linear string in the file, you can only append rows. A new row needs to be interlaced into the original file, shifting everything else. If you want to append rows, you need to build the entire output structure in memory and then write all at once.
    (I also don't think you need to set the file positions, it will be remembered from the last write operation.)
    Unless the files are gigantic, here's what I would do:
    (Also note that some of your rows have an extra tab at the end. If this is normal, you need a little bit more code to strop out empty columns. I include cleaned up files in the attachment. I also would not call them A.txt.txt etc. A plain A.txt is probably sufficient.)
    EDIT: It seems Dennis's solution is similar )
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Write to fileMOD.zip ‏6 KB
    MergeColumns.png ‏6 KB

  • Writing and reading data from a form

    I am trying to write a save and load feature for an application using mostly Jtextboxes and things. Basically I have a form that the user enters data into. I want to be able to save this data and load this data. I am relatively new to working on a GUI and I'm not quite sure if my knowledge of I/O applies to this. This is my stab at it but if I am completely off I would not be surprised. I don't want to print it to the command line but this was all I could think of right now. Any help would be greatly appreciated.     
    private void SavePrefs() {
              File SavePrefs;
              // get filename:
              fc.setDialogTitle("Select Filename For Site Data");
              int result = fc.showOpenDialog(f);
              if (result == JOptionPane.OK_OPTION) {
                   SavePrefs = fc.getSelectedFile();
                   // default file extension ".CMM"
                   if (!SavePrefs.getName().endsWith(".CMM")) {
                        // filename does not meet requirmeents:
                        System.out.println("NO CMIMS in filename");
                        SavePrefs = new File(SavePrefs.getAbsolutePath() + ".CMM");
                   // continue with save code:
                   System.out.println("File Selected:" + SavePrefs.toString());
                   //Creates a .cmm file with a code in it containing the data from the first site tab.
                   FileOutputStream out; // declare a file output object
    PrintStream p; // declare a print stream object
                   try
    // Create a new file output stream
    out = new FileOutputStream(SavePrefs.toString());
    // Connect print stream to the output stream
    p = new PrintStream( out );
    p.print(_SitePropPanel);
    p.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
                   JOptionPane.showMessageDialog(null,
                             "File is saved.");
              // not OK selected (cancel or.?)
         private void LoadPrefs() {
              File loadPrefs;
              // get filename:
              fc.setDialogTitle("Select Filename For Site Data");
              int result = fc.showOpenDialog(f);
              if (result == JOptionPane.OK_OPTION) {
                   loadPrefs = fc.getSelectedFile();
                   // default file extension ".CMM"
                   if (!loadPrefs.getName().endsWith(".CMM")) {
                        // filename does not meet requirements:
                        System.out.println("NO CMIMS in filename");
                   // continue with save code:
                   System.out.println("File Selected:" + loadPrefs.toString());
                   try
         // Open the file that is the first
         // command line parameter
         FileInputStream fstream = new
                                  FileInputStream(loadPrefs.toString());
         // Convert our input stream to a
         // DataInputStream
                             DataInputStream in =
         new DataInputStream(fstream);
         // Continue to read lines while
         // there are still some left to read
         while (in.available() !=0)
         // Print file line to screen
                                  System.out.println (in.readLine());
                             in.close();
         catch (Exception e)
                             System.err.println("File input error");
              JOptionPane.showMessageDialog(null, "Feature is not yet implemented.");
         }

    Oh and the GUI is a window with menus where the save feature resides, but the data is in tabbed panels. That is where the _SitePropPanel comes in. I know I want it to write the input from the panel and not the panel. What would would I use for that? I tried getInputContext().                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Flow of Information from Quotation to Sales Order

    Hi Group, Just want to understand is there any possibility to put a check while information is flowing from Quotation to Sales Order. Once information flows to Sales Order no one should be able to change the flown information in Sales Order. Any chan

  • Is rank() really better than rownum for top-n-queries?

    Several sources say that for Oracle databases rank() should be used instead of 'rownum <= n' for top-n-queries. But here we have an application, where we a lot of top-n queries are executed on a big table with several million rows and rank() has a qu

  • Sales Order or Order  in Oracle Crm On Demand application

    Hi Gurus, I'd like to ask You, where can I find something like Order or even Sales Order. I need to capture order, but currently I do not know how. There is a record called Opportunity but I don't know If it can be used for that purpose ?. Best regar

  • On VMM managed cluster hosts, I can't figure out why most of my hosts answer port 5900 and the others 2179, but not both

    Below, you see a netcat list of my hosts.  Most are answering port 5900, but not 2179.  The list on the bottom is answering 2179, but not 5900.  I need to know for 3 reason why this is, (1) to setup our enterprise firewall, (2) for port health monito

  • Problem updating 5800 software

    You have to update my 5800 has been successfully install the update and I am now the problem Akny I can not log messages to the final I do not know why For information, I've updated the system again and also did not solve the problem, what is the sol