02-15-2018 12:27 PM
Hi,
I want to communicate with my device (a CARD) equipped with a serial port.
First i must Open a com with 300 Baud rate, send a command and verify the response.
Second: Sent a command
Third: Open a second com with a Baud rate 9600 in the same Port
Fourth: Use Visa READ, and i must read a chain of character that confirm that open session is OK.
The problem is I don’t receive any response when i use visa READ in the Fourth Step and Bytes at Port = 0.
The picture below:
Solved! Go to Solution.
02-15-2018 12:39 PM
What does that second command do? Is it causing the device to change its baud rate? You are only waiting 200 milliseconds after re-configuring the port for the new baud rate and checking the number of bytes at port. Is that enough time for the device to react to the command for changing the baud rate and sending out a new message?
02-15-2018 01:43 PM
@RavensFan wrote:
What does that second command do? Is it causing the device to change its baud rate? You are only waiting 200 milliseconds after re-configuring the port for the new baud rate and checking the number of bytes at port. Is that enough time for the device to react to the command for changing the baud rate and sending out a new message?
Most of the equipment I communicate with serially requires the unit to be rebooted/reset to use the new baud rate. (It remains at the original baud rate until you reboot so you can send the reboot/reset command.) Are you sure you don't need to reboot/reset the equipment?
02-15-2018 02:21 PM
i have a assembly which i can use to communicate with the device, but i am trying to develop a module (library) to communicate with the device using Visa Serial.
i an snipping the serial port to watch the commands and te replys when using the assembly.
After that i trying to do the same thing using Visa Serial:
IRP_MJ_WRITE | DOWN | 2f 3f 21 0d 0a | /?!.. |
IRP_MJ_READ | UP | STATUS_SUCCESS | 2f | / |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 45 | E |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 44 | D |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 69 | i |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 35 | 5 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 31 | 1 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 41 | A |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 35 | 5 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 45 | E |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 34 | 4 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 45 | E |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 34 | 4 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 31 | 1 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 31 | 1 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 30 | 0 |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 0d | . |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 0a | . |
IRP_MJ_WRITE | DOWN | 06 30 35 31 0d 0a | .051.. | |
IRP_MJ_WRITE | UP | STATUS_SUCCESS | 06 30 35 31 0d 0a | .051.. |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 1 | . |
IRP_MJ_READ | DOWN | |||
IRP_MJ_READ | UP | STATUS_SUCCESS | 50 30 02 28 41 38 45 33 33 34 33 | P0.(A8E3343 |
and i tried more than 5000 ms but i don't receive any reply.
02-15-2018 02:22 PM
@RavensFan wrote:
Is that enough time for the device to react to the command for changing the baud rate and sending out a new message?
I actually worry about the opposite. Did the instrument change its baud rate and send out the data before VISA reconfigures the serial port? Though, I would expect an error if that were the case.
02-15-2018 02:23 PM
Yes i am sure i dont need to reboot the device.
02-15-2018 03:07 PM
Is there a reason you need to communicate with it at 2 different baud rates?
You never answered my question about whether that command was what told it to change the baud rate.
02-15-2018 03:18 PM
@RavensFan wrote:
Is there a reason you need to communicate with it at 2 different baud rates?
You never answered my question about whether that command was what told it to change the baud rate.
Yes i need to communicate with it at 2 different baud rates.
i ithnk this command Slect Work Mode: below the manual of the communication
02-15-2018 04:29 PM
Is this a really ancient device? I haven't heard of anything needing to communicate at 300 baud since the 1970's.
It's a shame they are giving you a really complicated scenario here. The fact it can route itself back to 300 baud without warning is a concern. It would be nice if that flowchart gave you some guidance on the timing for when it switches from one baud rate to another.
I'd suggest looking at it with an oscilloscope. Even use a DAQ device and record the transmit and receive lines. You might be able to see by the bit pattern when it changes from the slow baud rate to 9600 baud.
02-16-2018 01:56 AM
Maybe the echo to the Select Work Mode command is to be received at 300 baud as well, as an acknowledge to raise the baud rate?
I'm not sure if it makes much difference, however I would use a VISA property node to change the baud rate only.
Don't use Bytes at Port: you already set 0xA as termination character, so configure a proper timeout in the VISA Configure Serial Port and input a large number into the byte count terminal.