07-30-2019 05:34 PM - edited 07-30-2019 05:41 PM
Hello,
I am trying to control a power supply (NIOPS-4, attached manual) for an ion pump using basic serial read and write vi (attached), but having troubles with it.
I set baud rate to 115,200 as suggested in the manual and tried simple commands like V<CR>, V, B<CR>, B .. but I get timed out at the read section. I don't see any errors at the write section but "B" command which is supposed to turn off the power supply doesn't really work.
Can anyone tell me what I am missing? Also, what bytes to read should I use?
08-01-2019 11:29 AM
It state right in section 9.2 of the manual that this uses a handshaking protocol. You will need to send your command then await 2 bytes at port [ACK,CR].
Here is the handshaking at work (The <CR><LF> is shown as \r\n). Your entries/responses are on the left while the instrument ones are on the right below. There is normally a time limit to when the response needs to be received before timing out. This is one of the few cases where using the "Bytes at Port" for awaiting the 2 character acknowledgement from the instrument is useful and appropriate.
V\r\n
< ACK>\r
<ENQ>
NEGH.3 Jun 04 2011\r
The <ACK> and <ENQ> have the hexadecimal ASCII values of 0x06 and 0x05 respectively.
08-08-2019 04:39 AM
Hello,
I'd recommend do not use "Read" with predefined bytes count. It's better (and more efficient) first to check for bytes at port available. The main idea behind (sketched below):
You can play with poling interval (5 ms.) but it's good enough for 115,200 baud rate. Too big interval will slow down execution ... too short interval could miss the whole response (critical at low baud rate).
08-09-2019 03:27 PM
I tried attached script, but I don't get anything on read buffer when V command was sent. Please let me know if anything seems wrong.
08-09-2019 03:28 PM
I tried "Bytes at Port" as you mentioned, but unfortunately I am not still getting anything from the device unfortunately. I attached the block diagram above.
08-10-2019 06:37 AM - edited 08-10-2019 06:37 AM
1. Are you using a Null Modem cable? Page 24 under paragraph 9.1 clearly states "With the PC use a Null Modem cable." A normal straight through cable will not work.
2. Ignore the advice you were given about the Bytes At Port. This instrument uses a Command-Response communication scheme and a termination character. So it is fairly safe to assume you will get a message back within the default 10 second timeout. So first, enable the termination character and set it to the Carriage Return (13, 0xD). Then tell VISA Read to read more bytes than you expect back. The read will stop when the termination character is read. Here is how you should be able to read the software version from the instrument.