LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port time between bytes

hi there
since we upgrade from NT4 6i and serial vi running on a PC clone to win2k 7exp and visa vi's running on HP KAYAK XAs our interface doesn't answer anymore.
The problem is that visa is much faster to transmit the space between two byte words inside the instruction (i.e. a voltage)
We did measure it with a digital oscilloscope HP54510B plugged on the serial port wire...
SO HOW TO MAKE IT LONGER???? the baud rates have already been tested and it doesn't work either
by way
The "working" time delay between 1 and 0 of voltage 10 is 220microsecond (serialport vi's) and not 120 as visa vi's does
0 Kudos
Message 1 of 10
(6,351 Views)
If you are talking about the time per byte in the transfer it reflects the baud rate...but you say the baud rate has been checked? (Perhaps it is set another place as well, to a different value.)

If it's a matter of time between two bytes sent at different times to the write function you could just be fooled by now having a faster machine/code...in that case you'll need to include a wait at the right spots in the code.

Have you tried the LV7/VISA based code on another PC?
Message 2 of 10
(6,351 Views)
Have you tried increasing the number of stop bits? In asynchronous serial communication, the number of stop bits (typically 1, 1.5 or 2) controls the amount of time between transmitted bytes. 1 stop bit is the default in VISA Configure Serial Port (Instr).vi. If you increase that to 2, you get one more bit time between bytes. E.g., at a baud rate of 9600, one stop bit = 145 microsecond delay (minimum) between bytes; two stop bits = 290 microsecond delay between bytes.
Note: since the transmission is asynchronous, the sender and the receiver don't need to have the same number of stop bits, since that setting only affects transmitted data. If unit A is much faster than unit B, you could set 2 stop bits on unit A and 1 stop bit on unit B. When unit A transmits, it i
nserts two stop bits between bytes to give unit B more time to process the data. When unit B transmits to unit A, it inserts only one stop bit because unit A is fast enough to handle it.
0 Kudos
Message 3 of 10
(6,351 Views)
I tried both solutions
increasing stop bits from 1 (100µs)to 2 give 200microsec but the DAC still no answer
I tried to pause 1ms (not less is possible under LV?) between the bytes by separating the visa write of each byte with 1ms, but still the DAC no answer...
Desperately it was working fine on the old pc and old versions
Good old times...
Any other ideas or comments would be very appreciated guys, or send me an other pc to try it 😉
0 Kudos
Message 4 of 10
(6,351 Views)
Not a direct solution but...you could use the old serial VIs in LV7 as well, just copy serpdrv and the old VIs to the appropriate LV7 directories. We still use the old ones, works just a good as before LV7.
0 Kudos
Message 5 of 10
(6,351 Views)
WOAW
old serial vi's and serpdrv in which directory of LV7
Make me dream about it...
0 Kudos
Message 6 of 10
(6,351 Views)
Did you measure 200 usec at 2 stop bits or just calculate it? I would be surprised if 220 usec works reliably but 200 usec never works. If 220 was right on the edge, it would fail sometimes. If 200 was on the edge, it would pass sometimes.
1 msec timer resolution is a Windows thing, not just a LabView thing.
Maybe time between bytes isn't the problem. Does the new PC also use a new cable? Have you double checked other parameters: baud rate, parity, data bits, flow control, termination character, etc.?
Have you tried using Hyperterm on the new PC?
0 Kudos
Message 7 of 10
(6,351 Views)
Copy serpdrv to the directory where the LV7 exe is (you'll need to include it in the directory of any built applications as well, just as before).

Now you can either replace the .llb where the VISA substitutes are with the serial .llb from LV6, or as I've chosen to - rename all the old ones, save them in a library and put them in your user.lib. The former has the advantage that you don't need to do anything to old code, they will find the right VIs...if you go for the renaming you can have both the VISA and the old ones available at the same time.

Mads
0 Kudos
Message 8 of 10
(6,351 Views)
BINGO Captain oh my Captain
everything is fine now
Sounds MAD, thanks Mads! You would have spared us two weeks of system investigations but now we know everything about it...
0 Kudos
Message 9 of 10
(6,351 Views)
BINGO Captain oh my Captain
everything is fine now
Sounds MAD, thanks Mads! You would have spared us two weeks of system investigations but now we know everything about it...
0 Kudos
Message 10 of 10
(6,351 Views)