I am trying to collect data from a Sartorius scale at about 20 samples per second and record each measurement to a file. I have made a simple program using the VI's from the Sartorius drivers library present on ni.com. Basically, I use the Sartorius_Initialize vi to initialize the scale (i.e. find appropriate serial COM port, appropriate data interface settings, etc). Then within a while loop I use the Sartorius_Print vi to get the measurement from the scale and save the data to a file. Finally outside the loop I use Sartorius_Close vi to close the COM port connection. Also, I use a wait 50 milliseconds inside the loop to achieve my 20 Hz sampling rate.
The problem is when I open my file, I find that the data has only saved 10 times per second, not 20. I've tried bypassing the use of the Sartorius_Print vi, but I can't seem to establish a working communication with the scale. I've tried using Instrument I/O (express VI) to query and parse, but it works only sporadically. I should be able to just send it the print command ("P") but it's not working.
My 2 questions are:
1. Does anyone have any idea why the data would be saving only 10 times per second and not any faster?
2. How can I communicate with the Sartorius scale (either Instrument I/O or VISA read/write)? The manual says to use the command "Esc P CR (carriage return) LF (line feed)" How do I write an the escape, CR, and LF commands?
If it helps, I can attach some VI's I've been working on once I'm at work tomorrow. Any help is greatly appreciated.
Thank you.