LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffer read

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(2,864 Views)

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.

0 Kudos
Message 2 of 4
(2,857 Views)
Solution
Accepted by topic author akc

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,818 Views)

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.

Regards,
Daniel REDS
RF Systems Engineer

Help us grow.
If a post solves your question, mark it as The Solution.
If a post helps, give Kudos to it.
0 Kudos
Message 4 of 4
(2,809 Views)