12-02-2013 08:29 AM
Hi there,
I am attempting to interface Labview with a custom-designed power supply device through a USB-RS232 adapter. The power supply came with a "debugging interface" programmed in java with which one can send and recieve commands to the board (detect, set voltage, get voltage, stop, reset, etc.) through the USB-RS232 adapter which works fine.
I however am not experienced with java in the least and want to streamline command sequences with Labview, as I am interfacing the rest of my lab equipment with Labview. I dont have experience connecting serial devices, I do have USBTMC & GPIB VISA interfaces with the other equipment.
Nonethless I've tried the advanced serial communication example provided by NI, (http://www.ni.com/example/27665/en/) - I have appropriately set to COM3 as my device manager (and MAX) find the correct port for the device, baud rate, data bits, stop bits, parity, flow control, XON/XOFF characters, Input Buffer Size, End read/write with termination character, which termination character, and how long till time out.
Yet from my Portmon log, I'm seeing that the java interface sets a few other parameters that I (at the moment) do not have access to through the labview VI (or from MAX). How do I set Output Buffer Size? What are EOF? EVT? Replace? XON/OFF limits? WC? How do I set them?
Both Portmon log files are attached.
12-03-2013 10:48 AM
Output Buffer Size - This is set with the VISA Set I/O Buffer Size VI that is in the example you were looking at. The documentation says it is just the Input buffer size but it is actually the I/O buffer size.
This forum post answers your question about XON/OFF Limits:
I am not sure yet about the other commands you have asked about. Have you looked around in the VISA Serial property node options? Have you made any progress?
12-03-2013 11:23 AM
Hi Holly,
Yes, thank you! I thew on a second I/O Buffer size node and set the output size to 1024, so I now have correct input AND output buffer sizes.
In the thread you linked a couple replies say "Xonlimit/Xofflimit is only used with flow control on" and "You want to set XON/XOFF parameters, but you want flow control off? Then what's the point?" and I have flow control off, so I suppose these limits, or even values for XON/XOFF do not matter for me...
Still no idea what WC, EOF, EVT, Replace are and how to set them:
Java's WC = 0 vs Labview's WC = 500
Java's EOF = 4 vs Labview's EOF = 0
Java's EVT = a vs Labview's EVT = 0
Java's Replace = a vs Labview's Replace = 40
The VISA Serial Property node does not appear to have control for any of these values...
12-03-2013 12:37 PM - edited 12-03-2013 01:04 PM
I did find the "Replace Character" Property in the Instr node.
Edit: Actually this setting changes ERR & BRK to whatever number, not "Replace"
And I made a mistake in the post above, Java's replace value is = 0
12-03-2013 03:33 PM
Update:
from
http://msdn.microsoft.com/en-us/library/aa450503.aspx
It appears that
EVT = value of character used to end data
EOF = value of character used to signal an event
I'm thinking that these must correspond to Inst node's properties:
EVT - ASRL End In (end mode for reads)
&
EOF - ASRL End Out (end mode for writes)
although I've tried to set them to all allowable values (None, last bit, terminal character) and see no change to the program, still timing out when i send *IDN?
Nothing that resembles WC
12-03-2013 06:57 PM
12-04-2013 10:42 AM - edited 12-04-2013 10:45 AM
OK!! Problem solved! Dennis, you were right, I was overthinking it with these other parameters.
The board was waiting for a beginning of text character for every write command (hex 02), now that I look at the java programs .log file it seems fairly obvious.
Threw that character onto the beginning of every input string and now everything is working!
Thanks!