Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize the number of samples of the motor position and DAQ values

Dear all,

 

i am reading loadcell values from DAQ and also  controlling motor(SMC 100-i have labview drivers) in the same  program. I am using TDMS to record the "Motor Position", "Time" and "Load Value"

 

There is one problem which is :  the sample time of the DAQ and the Motor controller are different.  When i open the  excel file: recorded number of samples of the "DAQ time" and "loadcell value" is 9401  ,  while the number of samples of the motor position is only  95 . How can i take the same number of samples from both the loadcell and the motor controller?

 

I have attached the screenshot&written program.

 

Thank you for reading and answering.

Best regards from Turkey.

 

 

Download All
0 Kudos
Message 1 of 27
(4,117 Views)

Hello,

 

Does the SMC-100 allow you to do buffered acquisitions or can you only read a single sample every loop?  If software timing and single samples, like you are currently doing, is the only option for the SMC-100, then the only way to have the number of samples from the SMC-100 match the DAQ card is to also do software timing on the DAQ card.  Not really the ideal solution I know, but unless you can do buffered acquisitions with the SMC-100 that may be what you have to work with.

Justin Parker
National Instruments
Product Support Engineer
Message 2 of 27
(4,103 Views)

Dear Justin_P,

 

I changed the DAQmx rate from "1000" to "4" which means that i can take only 4 samples per second. and now the motor position's number of samples  are equal to the Loadcell values after the test completed. But 4 samples per sec. is very less for my Test set-up. how can i understand that SMC-100(motor controller) allow me to do buffered acquisitions?  While i was researching how to get more datas from the motor controller, i thought that maybe i can make it possible using VISA codes? (For example using "VISA Set input/output buffer size" after the port initialization) Is it possible? Am i on the right track? Is there any detailed tutorial about visa?

0 Kudos
Message 3 of 27
(4,081 Views)

The smc 100 is a slow communicator, increasing the baudrate helps. Buffersizes are not the problem.

greetings from the Netherlands
0 Kudos
Message 4 of 27
(4,074 Views)

Dear Albert.Geven,

 

How may i increase the baudrate then? I have SMC100 labview drivers but I could not see any vi which refers to increasing the baudrate.

 

 

Greetings from Turkey.

0 Kudos
Message 5 of 27
(4,072 Views)

The initialise function sets a default baudrate, open it up and see what happens.

VBut you also have to modify the internal baudrate first, see the manual how to do that

greetings from the Netherlands
0 Kudos
Message 6 of 27
(4,064 Views)

Dear Albert.Geven

 

57600 bauds rate is set for SMC 100 in labview  , i also checked this value from SMC 100 manual, it is also 57600. But i can only read 4 samples per second. This is very limited, very less value. I dont know why, pls help me 😞

 

Greetings from Turkey.

0 Kudos
Message 7 of 27
(4,046 Views)

If that is the max that the smc sends then that is the max and you can't do anything to change it. What exactly does the spec from smc say? If it says something greater is possible, then you can address why you cannot acquire any faster.

Message 8 of 27
(4,035 Views)

I agree with Dennis, you should contact Newport.  

 

I browsed their site and found "The typical execution time for a tell position command, for instance, is only in the range of 10 to ....", but this was when using 485.  It looks like they have done some benchmarking so ask what the max is for RS-232.

 

If it is under 250ms then we should back up and look at the code again.  Have you done any test with just the SMC100 driver VIs (no DAQmx)?  Is the DAQmx read blocking until it gets its 4 samples? 

 

Hope this helps,

Justin Parker
National Instruments
Product Support Engineer
Message 9 of 27
(4,033 Views)

First of all: thanks alot for your consideration.

 

One thing that I suspect is : i am writing the motor position to the TDMS file and in order to connect the "tell current position" to "TDMS Write" i am initializing an array, (turning element wire to the 1-D array) "tell motor positon.vi" gives element type of wire.

 

Is it possible that some of the datas are getting lost while forming 1-D array.  Because i understand from tdms that i have got 4 samples per sec. from motor position.

 

Best regards.

 

0 Kudos
Message 10 of 27
(4,024 Views)