08-04-2010 04:13 AM
Hi
I using a musashi dispenser unit with Rs232 for controller pressure and dispense time. I want to write program in Labview for this. They protocol looklike
DEFAULT is 19200bps.Data Length: 8 bit Start Bit: 1 bit Stop Bit: 1 bit Parity: None Flow Control: None
for instace the Dispense command is stx 04DI_ _(two space) etx
the checksum of this command is CF, which is calculate is 00-30("0")-34("4")-44("D")-49("I")-20("SPACE")-20("SPACE")=CF
can you guys help me calculate this in labview 8.6
thank you very much
Solved! Go to Solution.
08-04-2010 05:36 AM
A checksum may be computed in many ways. So refer to you manual. The first step will in almost every case be to use the function below
String To Byte Array Function
Owning Palette: String/Array/Path Conversion Functions
Converts a string into an array of unsigned bytes.
Each byte in the array has the ASCII value of the corresponding character in the string.
08-04-2010 06:23 AM
Hi
coq rouge i konw the step you told me, but i do not konw how to design the whole programme, can you attach a VI for me?
08-04-2010 06:42 AM
Generally we teach to fish rather than feeding code.
So please post copies of what you have tried and so far so we can help you get that hook tied on the end of the string.
Just trying to help,
Ben
08-04-2010 06:49 AM
This is the programme i am using now, but the calculation result is not right when i type 04DI\s\s in the string the result is not CF
08-04-2010 07:17 AM
Hi ben
could you please check the programme for me and point the mistake i should modify
thanks a lot
08-04-2010 07:17 AM - edited 08-04-2010 07:20 AM
replace your XOr with a subtract node then swap the two inputs to the subtract node.
Note:
THe for loop will auto indedx the array if you let it.
Or you could
String >>> String to byte array >>> Sum Array elements >>> XOr with "FF" then add 1.
Ben
08-04-2010 07:36 AM
Ben
i have replace the XOR node to sustract node, but it does not works, the result still wrong
08-04-2010 08:06 AM
So now I play a guessing game...
Did you swap the two inputs to the subtract as I posted?
It worked for me so please try to bait that hook again and again post an IMAGE (down loading on one machine and transfering to another just to look!).
Ben
08-04-2010 08:08 AM
HI
i think i get the right reslut, this is the right VI