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

If you could show that data was being lost when you built the array, I would be very suprised.

 

Super easy test would be to replace the Current Position output with the iteratation count of the while loop.  I'm betting that the TDMS iterates up one at a time.  Can you benchmark the time it takes to execute the Move Absolute and the Tell Current Postion parts of the code with the DAQmx calls disabled?

 

Thanks

Justin Parker
National Instruments
Product Support Engineer
Message 11 of 27
(1,326 Views)

Ok Justin_P , thank you again for reply,

 

 

The equipments are in the university's lab. i will do what you asked me to do toworrow.

 

Kind Regards and Best wishes.

0 Kudos
Message 12 of 27
(1,310 Views)

Dear Justin_P,

 

I replaced the Current Position output with the iteratation count of the while loop as you said. And when i open the tdms excel file, it is still 4 samples per second.

 

I also benchmarked the time it takes to execute the Move Absolute and the Tell Current Postion parts of the code with the DAQmx calls disabled. I still get 4 samples per second from the motor position. But i used the "initialize array" function both of them.

 

So is that mean it is true that while using initializing array.vi function some data are being lost or "initializing array.vi" decreases the samples which are taken per second??

 

If it is true then how can i turn an element type of wire to a 1-D array type of wire except using "initializing array.vi" , because to connect an item to "TDMS Write" , the item should be "1-D array" type of wire.

 

Kind Regards From Turkey.

0 Kudos
Message 13 of 27
(1,294 Views)
You can simply use a build array but the initialize array will not lose samples or slow the loop. To truly get an idea of the mac sample rate, eliminate the tdms write. Use tick count and a shift register to show elapsed time. I suspect you have a hardware limitation that has nothing to do with the code. You have already been told this.
0 Kudos
Message 14 of 27
(1,286 Views)

Dear Dennis_Knutson,

 

As you can see from the "PrintScreenLoopTime" attachment above, the loop iteration is arranged for 1ms (which means 1000 samples per sec.) then could you please tell me that  why i am still reading 4 samples per sec. although i connect a constant(loop's wait.vi's constant) not the hardware's output.

*I also used "build array" and result is the same(4 samples per sec.)

 

Thanks for your consideration.

Kind Regards.

0 Kudos
Message 15 of 27
(1,282 Views)
You can set the time delay to whatever you want but if the hardware requires more time, you just cannot force it to run faster. A hardware limitation is exactly that. Talk to the vendor about it.
0 Kudos
Message 16 of 27
(1,274 Views)

Dear all,

 

If we suppose that Motor Controller has this limited communication speed then:

 

I am communicating with the motor controller with USB cable which is also connected to a RS-232 cable . Is it possible that this converting to USB causing slower communication?

 

Thanks for your consideration.

Kind Regards from Turkey.

0 Kudos
Message 17 of 27
(1,259 Views)

No.

USB is way more faster than serial.

Please do the test without daq and see what the fastest speed of the smc is.

We have several of these instruments and have accepted that this is about the speed that is possible.

greetings from the Netherlands
Message 18 of 27
(1,255 Views)

Dear Albert.Geven,

 

here the pic. : I already did WithoutDAQmx involved, Still the TDMS writes "current position data"  4 samples per sec. But the real question is when i connect an another element wire(constant) to the TDMS file(after converting to 1-D array) , it is also writes 4 samples per sec.

 

Thank you,

Kind Wishes from Turkey.

0 Kudos
Message 19 of 27
(1,254 Views)

Are you saying that you eliminate the code for the motor controller and just have tdms write, that you only get 4 iterations per second? I find that very hard to believe.

0 Kudos
Message 20 of 27
(1,248 Views)