07-03-2017 03:07 PM - edited 07-03-2017 03:11 PM
My setup is a cRIO-9068
NI 9214 module
OMEGA Thermocouple with a fine diameter of 20 mm
My program runs fine with one channel and I can export the data so that it is in one column in a text file, however, my colleague wants a file that has each column correspond to each channel on the NI 9214 (Channel 0, Channel 1, ...) and each row will be the data. It's also delimited by commas. I attached my VI for how it works currently and what I get from it which is all the data in one column. Any advice on how I could implement that with multiple channels?
07-03-2017 03:46 PM
RT should not really stop. RT should not have a front panel. It should be running off on its own and you send commands to it via TCP/IP, Network Streams, etc. So what you should do is create a command to tell the VI to log for X time or samples. When the command is received, open/create the file. Then just write the data to file and then close the file when the time/samples has expired.
For more samples, just use more of the Scan Engine channels and use Build Array to combine all the data into a single wire. Then you can use Array To Spreadsheet String and then Write To Text File to log the data to your file.
07-05-2017 07:55 AM
How do I send commands to it? My colleagues wanted a GUI so that we can monitor our sensors and be able to control when to abort the test. Is that something the RT target is capable of? I was just given this hardware and started working with it. However, I do have a cDAQ as well if that's more suitable for my application.
07-05-2017 08:07 AM - edited 07-05-2017 08:09 AM
crios don't have the ability to run Front Panel code,
you may see your frontpanel in coding and debugging,
but finally when deployed and run in standalone,
there is no front panel stuff.
you have to have another computer to display the gui you have to build.
so RT reads the data, sends to UI, UI presents the data and sends back control, like start/stop.
note, that RT apps run from the moment you start the device (if set to autorun).
there may be options with webfrontend or somesuch, but i have no experience with it.
also have a look here https://forums.ni.com/t5/LabVIEW/data-saving-in-host/m-p/3654705 for links to crio help/guides
07-05-2017 08:12 AM
i think if it is a relatively simple application (and not very time critical), use network shared variables (exported from crio target),
then you can use them quite easily in your GUI app,
and dont have the hassle of setting up the communications part.
07-05-2017 08:19 AM
Currently I'm using the network shared variables and it's showing the data in a graph on the front panel with a numeric indicator. Can I still use it this way? I just plan on bringing the same setup to our test site with the host computer there as well to show my GUI and control it that way.
07-05-2017 08:29 AM
i guess so, you just have to make sure, that the variables are reachable from your GUI device
07-05-2017 10:25 AM - edited 07-05-2017 10:31 AM
Okay. It will be 600 feet away from the chassis. I don't think that should be a problem with a ethernet cable.
But I also got off the phone with NI application engineer and he said my best bet would be to use the cRIO undeployed because of the GUI that my company would like to use during the test for control and the serial interface it has which is needed for the test.
With that said, would anyone be able to help me with getting the CSV file formatting correct? I'm having trouble with getting the multiple channels out in the CSV file. Currently I have one channel coming out in one column but what would I need to do to get the multiple channels as the columns in the file separated by commas?
07-05-2017 11:53 AM
will have a go at it tomorrow ...
07-06-2017 04:31 AM - edited 07-06-2017 04:36 AM
i found several things in your code that may be improved upon:
- only use "initialize array" if you know your array size in advance
- don't use insert array for an ever growing array, where you just append, use build array
- use the shift-register output and not create another output for the same data
appended a snippet (you can drag+drop it onto a block diagram) with two channels of data as example
activate the context help (ctrl+h), hover over things and read the long help
if questions remain, feel free to ask