06-25-2015 02:32 PM - edited 06-25-2015 02:44 PM
I'm still getting the same timeout error. Is this what you meant by 0x03, chembo?
I also included the XOR calculation at the bottom that James suggested.
Edit: In the XOR that 83 should be an 80. I fixed that and it equals 82, which is 38 32.
06-25-2015 02:51 PM
@super_strong_dragons_n_stuff wrote:
I'm still getting the same timeout error. Is this what you meant by 0x03, chembo?
I also included the XOR calculation at the bottom that James suggested.
------------------------------------------------------
Edit: In the XOR that 83 should be an 80. I fixed that and it equals 82, which is 38 32.
I don't think you should include the STX (0x02) to the checksum. The manual says '.... XOR of all characters subsequent to <STX> ...
Remove the first element of the XOR calculation. Ans also make sure that all other parameters are correct, i.e. baud rate, stop bits, etc...
I think the reading of the reply is fine now. I don't think you need the 500 milliseconds delay, but you can leave it for now
06-25-2015 03:05 PM - edited 06-25-2015 03:08 PM
Man I just don't know why I can't get this working. I took out the 02 and fixed the command accordingly. Are these just normal numeric integers? Do I have to do anything special to them? I notice everyone keeps writing 0x03. Is that the same as entering at 3? For example, for the stop bit I just typed in a 3.
Also thanks for helping, everyone. You guys rock.
Edit: Baud rate and all that matches. I can communicate with the controller fine using some software given to me by Agilent.
06-25-2015 03:15 PM
Well, 3 is the same in decimal or hexadecimal. Since all numbers in the users manual of this device are shown in hexadecimal, I was writing also the 3 as 0x03, which is usually how hexadecimal numbers are shown in text. It is also always a good idea to show the radix of constants (right click/Visible Items/Radix) so that you make sure that your 80 is really an 0x80 and not decimal, which will be 0x50.
You say the the baud rate matches. Is it 9600. The default value of the 'config serial port' is 9600. I would set explicit baud rate, bits, etc...
06-25-2015 03:19 PM - edited 06-25-2015 03:21 PM
Are you sure your BAUD, DATA, STOP, PARITY, and FLOW CONTROL settings are the same as your device? From your screen shot, your using the default settings - 9600, 8, 1, None, None.
Edit: Chembo beat me to it.
06-25-2015 03:30 PM
@chembo wrote:
Well, 3 is the same in decimal or hexadecimal. Since all numbers in the users manual of this device are shown in hexadecimal, I was writing also the 3 as 0x03, which is usually how hexadecimal numbers are shown in text. It is also always a good idea to show the radix of constants (right click/Visible Items/Radix) so that you make sure that your 80 is really an 0x80 and not decimal, which will be 0x50.
You say the the baud rate matches. Is it 9600. The default value of the 'config serial port' is 9600. I would set explicit baud rate, bits, etc...
All this stuff matches. The specs are at the very start of this thread. The baud rate is programmable, but I've double checked it is at 9600.
06-25-2015 03:49 PM
If the configuration of the serial port is correct and your checksum is 0x38 0x34 (I am calculating it as 0x84), then I don't see anything wrong.
Did you try to debug with NI IO Trace. Check it out. It will show you exactly what is going in/out at the serial port. It is located in the Windows start menu (if you are using Windows OS) / National Instruments / NI IO Trace
06-25-2015 08:30 PM
chembo is correct. The CRC is calculated as 0x84. The protocol states the CRC is "hexadecimal coded and indicated by two ASCII charaters". So the checksum is appended to your command syntax as 0x38 0x34. You command should look like:
06-26-2015 10:41 AM
I don't see how you got 84, probably because I'm not doing the XOR correctly.
I just got off the phone with one of the controller technicians, and he told me I would need to create a LabVIEW driver since there isn't one in the NI library of drivers. Does this sound like it could be the source of my issues? I have a different device that I communicate with through serial and it didn't require any drivers, so I'm curious if this is a device specific issue.
What do you guys think?
06-26-2015 10:52 AM