NI Home > Community > NI Discussion Forums

Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Kindly-Wisher
Posts: 41
0 Kudos

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.

 

 

Active Participant
Justin_P
Posts: 299

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

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
Member
Kindly-Wisher
Posts: 41
0 Kudos

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

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?

Trusted Enthusiast
Albert.Geven
Posts: 3,345
0 Kudos

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

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

greetings from the Netherlands
Member
Kindly-Wisher
Posts: 41
0 Kudos

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

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.

Trusted Enthusiast
Albert.Geven
Posts: 3,345
0 Kudos

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

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
Member
Kindly-Wisher
Posts: 41
0 Kudos

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

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 :smileysad:

 

Greetings from Turkey.

Knight of NI
Dennis_Knutson
Posts: 34,065

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

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.

Active Participant
Justin_P
Posts: 299

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

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
Member
Kindly-Wisher
Posts: 41
0 Kudos

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

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.