12-31-2009 01:14 AM
HI
I am reading a data from a GPIB cable using GPIB read command and THEN I need to write to digital output port of 34907A multifunction module card of agilent then i record the GPIB read value ,digital value sent to 34907A and the timer in the labview pgm.
this cylce keeps on continuing for along time so i have put the whole SEQUENCE in a while loop.
The first frame of the sequence reads data from GPIB.
The second frame of the sequence processes the data and writes output to Digital output card and also stores values into an array.
The agilent DAQ is connected by using a RS232 cable at 9600 baud rate.
I want the whole cycle to run as fast as possible.so i did not put any delay inbetween the sequence frames.
I have attached a picture instead of the vi as many of you may not have the relevant agilent drivers.
NOW the question is:
My output file shows a constant time difference of about 60 msec between consecutive readings...which means every 60 msec there a new data being sent to digital output card..
1.But I am not really sure if my card is taking all the values that are being sent .I can see the display changing values from 0 to 1 and vice versa without any error.But how do i assure myself that it is really writing a new data every 60 msec?
2.Is it that only after the write proces sis complete will labview start exiting from the frame?
3.also if i change the baud rate to 19600 will the 60 msec time come down to a lesser value?
regards
Siva
12-31-2009 03:58 AM - edited 12-31-2009 04:07 AM
Hi Siva,
That 60 ms is a combination of the amount of time required to;
1. read data from GPIB, which depends on the number of bytes you read,
2. process the data and decide on the digital output value PLUS file write operation, which depends on the "processing" you make
3. pass the digitial output value to 34907 via 9600 baud rate, which again depends on the number of bytes you need to send for to make the update
I am not a LabView programmer (btw, this is the LabWindows/CVI forum, not LabView) so, I cannot understand from the picture if your processing takes time or how many bytes you read or send.
However, you cannot decrease the time you need to read from GPIB device unless there is a way to read the data in a compact (smaller number of bytes) form. There are some high-speed hardware like NI's USB-GPIB board, but you need to check that with the device you are reading data if it is also capable of transfering at that speed.
You can increase the baud rate on your PC's side but again 34907 must also be capable of communicating at that higher speed.
Consider that, it takes about 1ms to send a single byte over RS-232 with 9600 baud and about 0.5 ms with 19200 baud.
You can do the math for your case.
12-31-2009 07:13 AM
thanks for the detailed reply.
I am reading only one double precision data at a time and sending only two bytes of data to 34907a.
the processing time takes very little time one or two msec.
What i am worried is will labview start the next while loop before the actual write operation is completed and will it send the next write data command ?
what is exactly happening inside 34907a and is all the write commands be accepted is what i donot know..
Anyways sorry for posting in the wrong forum in fact i thought i had posted in labview forum .but later i could not find my post so i reposted it on labview forum.
regards
Siva