Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA write fails with no error during first attempt in flat structure--but succeeds in second

Hi all,

 

I'm having an unusual problem with a VISA write to two heater controllers via a USB-to-RS485 converter.  I restructured and rewrote the original VI for a particular process to add some additional cabapilities, but I made no modifications to the sub-VIs (which used to work with no problems).  The heaters are configured to be address 1 and 2 on half-duplex RS485.  To communicate with both heaters, I use (as my predecessor did) a flat structure to first write to the first heater, then wait to ensure latency doesn't get exceeded, and then write to the second heater.

 

Now, when I attempt to write a buffer of data containing a temperature setpoint to the heaters, it never properly writes the setpoint for the first address, whether that address is 1 or 2.  It always writes the second operation in the flat structure (address 1 or 2) without any difficulties.  In addition, there is no transmission corruption, because I can also read the temperature output from each heater independently and repeatably with no problems.

 

The first heater to be written always throws warning 1073676294 during the read directly after the write, so I tried increasing the number of bytes in the buffer (though the heater installation instructions specify 8 bytes in 8n1).  This removed the warning, but the write still does not happen, and no error or warning is thrown.

 

If anyone has encountered an error before or has some idea what might be causing this root problem, I would really appreciate it.  I feel like I've run out of trees to bark up, and I know some basic programming concepts but the water of driver- and hardware-level communication is a bit deep for me.

 

Attached are: a screenshot of the relevant problem structure; the sub-VIs associated with the read/write; and the top-level VI (though it will be missing some sub-VIs not relevant to this problem).


Thanks in advance!

Download All
0 Kudos
Message 1 of 4
(3,108 Views)

Hello,

 

Have you been able to write to both addresses successfully in the past?

 

Just so I understand your problem, the first write never works, regardless of which address you are writing to.  But the second operation always works, is this correct?

 

Regards,

 

National Instruments
0 Kudos
Message 2 of 4
(3,058 Views)

Hi Chris,

 

Thanks for responding.  Yes, this is correct; the first write never works (no matter the address), but the second always does.  

 

I have been able to write both addresses in the past using the flat structure inside a while loop.

 

Thanks,

Maia

0 Kudos
Message 3 of 4
(3,042 Views)

Do you get a warning or something?

0 Kudos
Message 4 of 4
(3,021 Views)