Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Serial write collisions

I am using Visa serial read and write commands to communicate with a products communication bus. The bus in a 3 wire RS-485 bus and has 3 terminals that can read and write to the bus (My pc, User interface board, and main PCB). I am using a 485 to 232 converter and then a 232 to usb converter to communicate from my pc.

 

The user interface board and the main PCB are constantly sending messages back and forth and my labveiw program has no problems reading the messages and picking out the data bytes I need.

 

The problem I am having is that in labveiw I can't find anything that tells me it is clear to send a message from my pc to the bus. None of the VISA wait on event options seem to work.

 

 

 

 

0 Kudos
Message 1 of 7
(3,692 Views)

Hi,

 

As far as I know there is no collision detection at a RS-485 interface.

Normally the protocol will handles this.

 

Or you can switch to 4-wire RS-485 so you can operate in Full-Duplex.

 

Can you tell a bit about your application ?

 

Kees

0 Kudos
Message 2 of 7
(3,682 Views)

Well, the User inteface has two periodic messages that are sent every ~100ms and they get an immediate response back from the main PCB.

 

I am trying to use labveiw to stuff an additional Diagnostic message and a response in that 100ms window all well reading and decoding all the messages on the bus.

 

Essentially the application will tell the user interface to enter a test mode, and allow my labveiw tool to issue commands to the user interface which will then communicate with the main pcb.

 

So far I have tried sending my message as soon or shortly after I see the last byte of a response message no luck, I have also tried checking to see if the bus is empty (using visa property bytes at port) and no luck either. Every once in a while both methods end up causing a framing error in my read loop thus a collision occurred.

0 Kudos
Message 3 of 7
(3,676 Views)

If I understand correctly there is a second application running that communicates with the port.

In that case I don't think it will work. I am even surprised that you can access the port with the other application running.

0 Kudos
Message 4 of 7
(3,664 Views)

Not two Labveiw applications, there are two PCB's (User interface board and main board) and they communicate normally with each other. Now I'm writing a single labveiw program to communicate with the User interface and monitor all of my feedback messages normally on the bus

0 Kudos
Message 5 of 7
(3,660 Views)

OK, I (think) I understand.

 

The way you tried it is, I think, the best option.

 

Maybe you can look for a device answer rather then waiting till there is no data on the line.

If you can detect the beginning of a message previous to the 100msec pause you can start (maybe add a little delay) your communication. In that way you can start directly at the beginning of the 100msec window.

0 Kudos
Message 6 of 7
(3,656 Views)

Hi

maybe a better way is to connect your pc inbetween both applications.

In this way you may send the commands from the UI to the main PCB and from the main pcb to the UI and stuff your own system commands inbetween.

The only problem is that you need two converters.

greetings from the Netherlands
0 Kudos
Message 7 of 7
(3,652 Views)