06-06-2012 01:06 PM
OK so I need to be able to turn multiple byte numbers into a string so the write function can do its job. (I am also missing the unsigned short int checksum. That's what the extra blank slot is for.)
06-06-2012 01:15 PM
@kstipe wrote:
OK so I need to be able to turn multiple byte numbers into a string...
I find the type cast works well. Just make sure your byte order is correct. Convert all of your numbers into a byte array and then use the Byte Array to String primitive.
06-06-2012 01:17 PM
any chance you could post that as a VI? I'm still new to labview and learning the componants of it.
thanks
06-06-2012 01:24 PM
You apparently have LV2011. I posted the image as a snippet. So you can save that image to your disk and drag it onto a block diagram and there's your code.
06-07-2012 03:31 PM
Ok. I have done everything in my power to get this command to go through, bit I still don't understand what is going wrong. Any insight would be much apreciated.
The first link is the program
the second link is the manual for those who didn't see it from before.
06-08-2012 03:01 PM
I do not understand your equipment, so I can't say exactly what you are doing wrong. But here are some programming pointers that may help you.
First of all, the sequence structure does nothing for you. Don't bother with it. Secondly, label your constants. I recommend labeling them as what setting they are. Third of all, if you are going to use the hex display, show the radix so that it's obvious that we are dealing with Hex. I had one program where the difference between Hex and Decimal kept coming up and was 90% of our problems. Finally, you only need to convert to U8 array those types that are not bytes. The bytes can just go into the build array and it will handle them just fine.
06-08-2012 03:40 PM - edited 06-08-2012 03:42 PM
ok great! now I have a question.
what is cmd?
and do I need a value in the U8 array? that has a little indicator scroll wheel that sycles through numbers.
and are those converted into bits already?
06-08-2012 04:44 PM
Now you are getting tripped up by not understand LabVIEW basics. The emtpy array wired to the typecast is 'type' just a way to tell the typecast function what to convert to. In this case, convert the input to an array of U8s. The contents of the array wired to the 'type' input are irrelevant.
The byte labeled 'cmd' is just a generic label - as is the entire example. Your bytes, the values, the order, the quantity have to match your documentation. For your specifically, you need 1 byte equal to sync_code1, 1 byte equal to sync_code2, etc. I have no idea what specific values are sync_code1, sync_code2, etc.
06-08-2012 04:47 PM
Ok. Thank you. I will be back later with more questions, I'm sure.
06-15-2012 10:45 AM - edited 06-15-2012 10:48 AM
http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/numeric_data_types_table/
(this was just for tec support. not an actual question for the forum. It can be disregaurded. Thank you)