01-07-2013 11:41 AM
Hello, I new to labview. I am trying to program power supply (BK 1786A) connect by RS-232. I am just trying to get started with reading the voltage and current on the powersupply but it reads the command ( GETD\r for getting preset Voltage and Current) and returns as GETD\r0090000\rOK\r -here i am just applying 0.9V and now my question is- IS there way to get just voltage reading not the whole character return thing? Thanks for any reply in advance.
Solved! Go to Solution.
01-07-2013 12:01 PM - edited 01-07-2013 12:02 PM
Are you sure your going to return 16 bytes of data back?
I would put a flat sequence structure (after the write command) with a wait command of 500 milliseconds, then place a "Bytes from Serial Port" after that and wire that to your read function.
01-08-2013 07:44 AM - edited 01-08-2013 07:45 AM
Since it looks like everything is being terminated with a carriage return, you might want to enable the termination character. Then set the number of characters to read to something rediculous like 1000. VISA will then only read until the termination character is received.
EDIT: I just noticed that you are using a GPIB resource and then using the configure serial port. I'm kind of suprised this is not throwing an error.
01-08-2013 08:14 AM
Hello akc,
As crossrulz stated, you are using a GPIB resource by default, but you are stating that you use RS232. Is your BK 1786A connected to the COM (serial) port of your computer? If so, you need to specify the COM port as the VISA resource. I would advise you to use the Basic Serial Write and Read.vi example in LabVIEW (Help » Find Examples » Hardware Input and Output » Serial). Try with 9600 bauds, no parity, 1 stop bit and no flow control. I was only able to find two datasheets here and here. And neither specify the serial paramters that the instrument supports, but the default settings almost always work.