04-25-2008 10:51 AM
6.3 CHECKSUMS
The checksum is computed as follows:
adding 14, 44(ascii comma), 100 together = 158, so 10011110, then complement it i get 01100001
if i clear the most significant bit, i assume that means delete it?: 1100001
then set the most significant remaining bit, that means make it a 1? so i get 1100001 (dec:97 hex:61)
http://img215.imageshack.us/img215/5486/visaerrormz3.jpg
This error is different if i unplug the power supply, so that means that the LabView is at least seeing the powersupply on COM3, which is good. but what i did above definately doesnt work ![]()
04-25-2008 11:29 AM
Have you searched the Instrument Driver Network to see if a driver exists for the supply? If there isn't one, you should provide the make and model of what you are using.
What you are attempting to do is fairly common. One particular thread sticks in my head becuase of the large number of posts. There were several code examples posted there on formatting to hex and how calculate a checksum. You should also post any code you've written so people can examine it for errors.
04-25-2008 11:36 AM - edited 04-25-2008 11:37 AM
04-25-2008 11:40 AM - edited 04-25-2008 11:41 AM
04-25-2008 11:44 AM
04-25-2008 01:25 PM
I didn't look at the error before because I really don't want to view something that is hosted elsewhere. I'ts better to just attach something to your post (use the Browse button next to the attachment filed below the message body). I guess I was assuming that you had a read error as write errors are not nearly as common.
I have seen that error reported with certain USB-RS232 adapters. See if this helps.
05-01-2008 02:58 PM
05-02-2008 08:11 AM - edited 05-02-2008 08:12 AM
No, you don't format the string in that manner. In LabVIEW, you have several options. One is to use a string control/constant set to hex display. You right click on the control/constant and select this option. Then you would just enter the values you hvae without the '0x'. another way is to create an array of U8 values. Then the Byte Array to String function can be used. In your case, assuming that you will be selecting different commands and needing to calculate the CRC, this would probably work the best as you can some fixed array values and use the build array function with the values you provide and calculate. In that long post I provided a link to, there was an example of that.
05-04-2008 06:27 PM
05-04-2008 06:50 PM
That's an array constant. On the array palette, select Array Constant. On the numeric palette, select Numeric Palette and drop that into the array constant. Right click on the numeric and select Representation>U8. Right click again on the numeric palette and select Display Format. Select hex. Right click on the numeric constant again and select Visible Items>Radix.
You are going to have to master some of the basics of LabVIEW to get your program to work. I would recomend starting here.