This is a really simple question...
I have an experiment where I control a servo's position using a myRIO, and I record the servo position and various loads using a cDAQ 9178. I control the myRIO using a RT VI (main_control_v1 in the attached project), and I control the cDAQ with a single "basic" VI.
How can I combine the 2 VIs? I want to be able to set various control parameters and hit run once on a single VI to upload the parameters to the myRIO and start recording with the cDAQ.
Sidenote: Does Linx's Arduino toolkit for LabVIEW enable a "1-click exportation" of my servo control RT VI to an Arduino Uno? Or do I have to rewrite my code using the toolkit?
The recording VI is "experiment_record", and the servo control VI is "main_control_v1" in the "myRIO_filter_control" project (all zipped & attached).
Solved! Go to Solution.
One way that I can think of would be to basically implement an architecture where your myRIO startup VI waits to receive parameters from a host computer (say by TCP for instance). This same computer could also be connected to your cDAQ-9178 over USB and could run the appropriate DAQmx code. This does not include the fact that the myRIO would also need to have a separate VI deployed to it or running as startup. You couldn't have a single VI which you deploy to the myRIO which would also tell the cDAQ what to do, but you could have a VI on the myRIO send a message to the host to tell it to call a VI containing the code for the recording.
With regard to Linx, I think certain code may work but Linx targets don't necessarily operate in the same way or support all of the functionality of our Real-Time targets. From looking at your VI, I would expect some rewriting of code to be necessary, as you are using some of the myRIO express VIs. These will not be compatible with an Arduino, as they make use of the FPGA. As far as I'm aware, the Linx toolkit also won't run "headlessly" on an Arduino- as in it will still need to be connected to a computer for code to be deployed and run. I believe that the Arduino Compatible Compiler is intended to address this and allow headlessness/embedded software deployment. See below for further information on the Arduino Compatible Compiler.
Arduino™ Compatible Compiler for LabVIEW by Aledyne-TSXperts
Regarding myRIO + DAQ: Thanks for the architecture suggestion. I figured I'd have to use some sort of triggering, but TCP/IP sounds a lot easier! My (recently expired!) Cisco CCNA certificate will finally come in handy...
I'll see if I can follow this and post my results here for progeny.
Regarding real time Arduino: A user on the Linx forums also suggested an Arduino compiler (7 day evaluation), and I successfully managed to create a "headless" (I like this word) control system for my setup. Unforunately, I'm having weird lag issues.
Happy to help! If you are having lag related to the deployment on your Arduino from that compiler, I would reach out to TSXperts who makes the compiler to see if they have any suggestions. Best of luck going forward!
Can I use TCP in reverse? That is, can the cDAQ prompt my computer to compile & run a program on the myRIO? I need the cDAQ VI running for a varying amount of time before the myRIO program starts.
Since this forum is already solved I think it would be best if you create a new forum with this specific question. That way the community/NI will be respond faster and we will keep the forum in order.
The cDAQ doesn't actually do any of that itself, so it can't be the source of the TCP packet. The computer tells the cDAQ what to do and gets the readings back from it. What you could do is have the computer start the cDAQ related code and have the myRIO code wait to receive a certain TCP packet in order to transition to the rest of the myRIO code. You could have the code running on the computer send that packet when that varying amount of time is met. You then could have a loop running before the rest of your myRIO code (enforced by dataflow or a sequence structure) which does nothing but check for that TCP packet repeatedly, and when that loop is stopped the rest of your code can execute.