11-29-2007 08:49 AM
11-29-2007 09:06 AM
Well, clearly there is an error in the transmission. Otherwise, you would be be reading something back. The fact that you don't get a LabVIEW error when doing the write is pretty meaningless. There is no verification by LabVIEW of the bytes sent, the com settings, or even if there is anything connected to the serial port. There will be no bytes to be read if the instrument does not get the correct command.
You haven't provided the entire data string, how you calculated the check sum, the name of the instrument, the programming manual, or answered whether you can communicate with a different program, etc. With the VI you are using, enter the data string and then go the the LabVIEW Edit menu and select "Make Current Values Default". Save the VI and post that. Post an electronic copy of the programming manual or a link to it. Double check the type of serial cable you are using. Make sure it is wired the same way that the programming manual describes. You also mention a max inter-character delay. If there is a minimum delay required, you will have to code that into your program.
11-29-2007 10:55 AM
11-29-2007 11:53 AM
The creation of the data is pretty convoluted and could be much simpler. I don't have much time to really look at it right now but I did create an indicator at the input to the VISA Write and it appears you are sending 14 bytes. The document you attached seems to imply 16 bytes should be sent. There could be a mistake in the checksums you are calculating. A thread that you might want ot look through is http://forums.ni.com/ni/board/message?board.id=170&thread.id=262115&view=by_date_ascending&page=1.
If you have an example of a complete data string from the vendor, you could use a single string control set to hex display and test that. You could also use a program like portmon to monitor the vendors program and try to duplicate the data that is being sent by that.
11-29-2007 10:42 PM
11-30-2007 06:05 AM
11-30-2007 02:41 PM
Everything in the output looks good in bytes 1 to 12. In other words they seem to be in the right order and XOR'ed okay as compared to the excel sheet.
A few things raise questions for me though.
1. Bytes 3 and 4 are the length of the SABus and have a value of 7, what portion is the SABus, bytes 5-12 are 8 bytes. Perhaps n is 4?
2. The checksum is the sum of bytes 1 through 2*n+4. N=7, so 2*n+4 would equal 18, but the bytes go up to byte 12 (w/o the checksum) and only 14 if you count it.
3. Are you sure that the checksum is a single byte duplicated? You are taking the sum, casting it to a single byte, then repeating it. Nothing implies that to me. Perhaps it should be cast to a U16.
4. It seems unusual to have a checksum within a checksum. There is byte 11 as a checksum, then later bytes 13 and 14 to wrapup all the other bytes. Not necessarily a problem here, it just seems odd.
After reviewing my list, I think the real problem lies in either #1 or #3, or both.
12-04-2007 10:04 AM
@Ravens Fan wrote:
Everything in the output looks good in bytes 1 to 12. In other words they seem to be in the right order and XOR'ed okay as compared to the excel sheet.
A few things raise questions for me though.
1. Bytes 3 and 4 are the length of the SABus and have a value of 7, what portion is the SABus, bytes 5-12 are 8 bytes. Perhaps n is 4?
2. The checksum is the sum of bytes 1 through 2*n+4. N=7, so 2*n+4 would equal 18, but the bytes go up to byte 12 (w/o the checksum) and only 14 if you count it.
3. Are you sure that the checksum is a single byte duplicated? You are taking the sum, casting it to a single byte, then repeating it. Nothing implies that to me. Perhaps it should be cast to a U16.
4. It seems unusual to have a checksum within a checksum. There is byte 11 as a checksum, then later bytes 13 and 14 to wrapup all the other bytes. Not necessarily a problem here, it just seems odd.
After reviewing my list, I think the real problem lies in either #1 or #3, or both.
12-05-2007 02:03 PM
Hi Lorenzo,
To display bytes 10-13, you can place them in an array and wire the array to a waveform. Since they are in the IEEE float format, you shouldn't have any problems placing them in the array.
Regards,
Rima
01-16-2008 04:30 AM