06-11-2014 01:38 PM
Hello,
A short glimpse of what I am trying to do:
I have a zigbee radio hooked up to an NCD AD1216 board. I also have another zigbee hooked up as a serial in my computer. I need to send a Decimal format write command to the remote zigbee and have it deliver back the same format data.
Problem:I can only seem to send text data. I always get hooked up with errors in the Visa read portion of the code. I am trying "Typecast" but there are still errors. I need to send for example "254 33" and it should reply with "85" instead I believe it is sending in either ascii or hex format.
Thank you very much in advance!
Solved! Go to Solution.
06-11-2014 02:01 PM
First off, what is the error you are getting.
Second, what do you need to be sending to the board? You gave the example: "254 33". Does that mean a 6-character string, or two U8s with the values of 254 and 33 (decimal) respectively? Likewise, is the response two ASCII characters or a single U8 with the value 85 (decimal? hex?)
Mike...
06-11-2014 02:10 PM
Judging from here (AD1216 Analog to Digital Conversion Commands), it look like those are decimal numbers that need to be sent. So I recommend using an array of U8. Make the first value 254 and the second 33. Then use the Byte Array To String node. For your data back, use the String To Byte Array. The first element of the return array should be an 85.
06-11-2014 02:13 PM
Hi!
I am getting error -1073807339.
I need to send the number 254 followed by 33 followed by etc. in decimal format. I don't know how that handles the space, but I have tried concatenate, and typecast with a numeric input. The numeric input however does not allow the space.
I do not know what I need to send whether it is a 6 character string or two U8's until I figure out which one works. I am assuming the 2 U8's but the VISA write does not accept 2 values.
The response for now is just 85, but we will need multiple values for example "128 08 00..." Sooo... I think multiple U8 values on the response as well?
Thank you! and hopefully I have cleared it up? Please let me know if I have not.
06-11-2014 02:17 PM
stevenette wrote:
I am getting error -1073807339.
Timeout expired. How many bytes are you telling the VISA Read to read? Do you have the termination character turned on?
06-11-2014 02:24 PM
1. I have attached a very basic file of what I am trying to do. Typecast is deleted, but just a simple diagram that hopefully helps. Taken from the examples online.
2. How do I implement the arrays into the flow and change their size?
06-11-2014 03:09 PM - edited 06-11-2014 03:09 PM
I'm picturing something like this. You can manipulate the command and response arrays as much as you need using the functions in the Array palette.
06-11-2014 03:17 PM
@crossrulz wrote:
I'm picturing something like this. You can manipulate the command and response arrays as much as you need using the functions in the Array palette.
*Off Topic* - How did you include the frontpanel in the snippet?!?
06-11-2014 03:27 PM
LAVA Code Capture Tool can do a few things the snippett tool cannot
On topic: a few additions that make some sense.
06-11-2014 03:30 PM
@MrHappyAsthma wrote:
@crossrulz wrote:
I'm picturing something like this. You can manipulate the command and response arrays as much as you need using the functions in the Array palette.
*Off Topic* - How did you include the frontpanel in the snippet?!?
Code Capture Tool. It is way better than the built in snippet tool. Look for it in VIPM. Once installed, you will find a Tools->LAVA->Code Capture Tool menu item. Feel free to play around from there.