From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

myRIO digital input and NI 9237 analog input

Hi All,

 

I am acquiring digital encoder data through a myRIO every 10 milliseconds using a timed while loop and the encoder express VI. I am also acquiring analog force data through a load cell connected to a NI 9237 module. How can I acquire record the displacement and force data with matching time stamps? I have seen a few examples using the shared sample clock however I am using a time stamp function to generate the time data for the encoder data would I have to remove my encoder express VI and replace with daqmx functions? I'm unsure about this because I'm deploying the encoder on the myRIO.

 

Furthermore, I would like to use the force data as feedback to the myRIO VI. Now I understand that with two different pieces of hardware it might not be possible to transfer data between them in real time but what would be the best way to minimise the delay between the two?

 

I'm happy to provide more info or clarification if this is not clear enough, I'm pretty new to labview so please excuse any naivety.

 

Cheers,

Ben

0 Kudos
Message 1 of 5
(3,089 Views)

Hi,

 

Which chassis is the NI 9237 in? The possible approaches to this question vary quite a bit if you have a cDAQ vs cRIO, as well as if you have available slots in the chassis.

 

For the myRIO side of things, you would continue to use the normal encoder function, as DAQmx functions are not available on the myRIO.

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 2 of 5
(3,011 Views)

THe NI 9237 is sitting in a USB carrier the NI USB 9162

0 Kudos
Message 3 of 5
(2,946 Views)

Synchronizing measurements / timestamps might be tricky. 

You might be able to split one of the inputs going to the 9237 and mirror it to an input on the myRIO. Then use it as some sort of trigger (e.g. don't worry about reading actual data from it - just use it to trigger when you read data on the myRIO). Or, maybe you could do this in reverse - have a digital or analog line out from the myRIO that you set high right before you will acquire data, then read that line in on the 9237 and use that to programmatically decide when to read force data on the main input(s) of the 9237. However, I'm not sure if either of these will be easy on the 9237 - in fact, both of these options are a little messy. Maybe there is a better / cleaner solution out there.. but with only the carrier chassis and 9237 we are slightly short on options for synchronizing.

 

As for transferring data, you'll need to pass it through your development PC. Once you've received the data on the PC from the 9237, you can use a network stream to losslessly transfer it from the PC to the myRIO. Information about network streams (including some pictures of code) can be found in the CompactRIO Developer's Guide.

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 4 of 5
(2,921 Views)

I would probably prefer to do everything on the myRIO and build yourself up a simple bridge circuit/amplifier and read that into one of the analogue inputs on the myRIO.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 5
(2,896 Views)