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.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Synchronizing Chai 3D( program run in Microsoft Visual studio 2008)and LABVIEW

You'll find the full project and source attached.

 

Some info. This is very similar to what the exe does, but I removed all the graphics and everything else not needed for collecting data. So it should be pretty fast.

The way it works is that you initialize a device with the init VI. This opens the device and starts collecting data. The data is stored in a buffer internally and you retrieve it with the get data VI. Then you close the device with the close VI.

 

The data is timestamped when it's saved to the buffer. The timing function used for that is very precise, in the microseconds range. There's also a VI that access this timing function. Because of this, I recommend that you first open the device, then start collecting and saving data from it in a loop (make sure to add a wait vi to the loop so that the VI isn't called to often, see the vi help). Then after a moment, in the other loop call the NI DAQ to start collecting that data. At this point the heptic device should've already started logging data. So just before the DAQ starts collecting data for the first time note the time using the device time VI this way you'll be able to find the time that the DAQ started sampling relative to the timestamps of the heptic device data.

 

So, I think the heptic device data will have very precise timestamps. The DAQ data timestamps should also be very precise since they are continuous waveform. The only issue might be is that we don't know exactly when the DAQ starts to save data so we have no way to be sure that the time stamp that we saved when we called the DAQ VI is when the DAQ actually started sampling. Maybe someone else knows how we can precisely get the time when the DAQ started logging data.

 

All the VIs and controls are documented in the help window.

 

Also, I figured out how to get the force data using the dll+ labview project I posted earlier. Basically, the force is the force that you send to device. In the exe and this dll which is similar to the exe, everytime we note the position of the device internally, we also tell the device to apply a force. The force is a function of the position. This is the force logged. If you wanted to use the (falcon) dll posted initially, you have to do this yourselve. The device force is whatever you set it to be. So if you wanted to log the force, you just have to know what the force was last set too. You could even imitate the exe with this dll by in a loop reading the device position with the VI and the send back a force to the device which is a factor of the position.

 

Since I don't have the device, I couldn't really test any of the above, but it should work. Let me know if something is not working, or if something isn't clear.

 

Matt

 

P.S. As per the GPL, the whole source is also attached.

 

Edit: For some reason when I replied to this thread (http://forums.ni.com/t5/Measurement-Studio-for-VC/Synchronizing-Chai-3D-program-run-in-Microsoft-Vis...) it created this new thread. It also didn't post one of the attachements I tried to post (15MB). I'm afraid to repost it in case that'll create another thread... Can someone clearify what happened?

0 Kudos
Message 1 of 2
(5,216 Views)

Hey myle00,

 

This is a known issue. There is a workaround in this thread http://forums.ni.com/t5/Feedback-on-NI-Discussion-Forums/New-Messages-Created-when-Replying-and-Serv..., but basically it's and issue with lithium. Sorry for the inconvenience.

 

-Nathan H

Software Developer
National Instruments
0 Kudos
Message 2 of 2
(5,193 Views)