06-29-2014 06:24 AM
Hello,
I will explain the things clearly
Transmitter section:
The receiver(Microcontroller) needs this data to respond 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0x0D.So,from Labview I need to send this data.
Receiver section:
In return the receiver(Microcontroller) sends the data to transmitter in this format
0x01 0x02 <18 bytes of information data> 0x03 0x0D.Later, the information will be post proecessed.
Can someone explain me clearly of what to send from Labview VISA so that the receiver recieves this data 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0x0D.
Thanks.
06-29-2014 07:05 AM
And the communication protocol of says
e.g, to write a value of 0x456789 to address 0x12, message format is
“0x02 0x31 0x32 0x34 0x35 0x36 0x37 0x38 0x39 0x0D”
To send 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0x0D from Labview what should be sent ?
can someone clearify this as well.
06-29-2014 07:52 AM
06-29-2014 08:13 AM
Hello,
I tried like this but it shows error as shown here
Can someone explain what is cause of this error and how to overcome this.
Thanks.
06-29-2014 08:22 AM - edited 06-29-2014 08:23 AM
It looks like your protocol uses Carriage Return (0D) as a termination character. The VISA Configure Serial Port VI uses Line Feed (0A) by default. You need to change the termination character to 0D.
Then get rid of Bytes at Port. Set the Byte Count input of Read to a number larger than the longest message you expect to receive. You indicated that the format specifies at least 22 bytes, so make Byte Count = 100. You can also eliminate the 1 second Wait because the Read will wait as long as needed to get the next termination character.
Add a VISA Close after the loop so that the serial port is properly shut down. Otherwise it may not work the next time you try to use it.
Lynn
06-29-2014 08:24 AM
06-29-2014 09:15 AM - edited 06-29-2014 09:17 AM
Thanks for the help.
I made these changes and the transmitter(ucontroller) is responding
1)Changed termination character to 0D in VISA Configure Serial Port VI.
2)Byte Count = 100 and 3)representation of the data array to U8
But I am not sure of
1) How to add VISA Close and
2) Why I am getting the wired read values as attached.Whereas the controller sends data in this format 0x01 0x02 <18 bytes of information data> 0x03 0x0D.
Can I get assistance with the receiving part as well to get the required data such that each time I receive this data (0x01 0x02 <18 bytes of information data> 0x03 0x0D)
3)I want to separate the information data into 6 parts such that each part contains 3bytes
4) converting these 3bytes data into 2's complement
thanks.
06-29-2014 09:40 AM
06-29-2014 09:50 AM
Have you worked through the on-line tutorials for Getting Started with LabVIEW? Answers to simple things like how to change display style and how to connect a function after a loop should be apparent after learning what those tutorials are trying to teach.
Pop up on a string control, indicator, or constant and select Visible Items >> Display Style. That will change the apparance to show which display style is active. About 2/3 down the pop up menu on a string control or constant are 4 choices for display style. You want the last one: Hex Display.
Here are images of how the same data looks in the three dispaly styles, one way to separate your data, and Close.
Lynn
06-30-2014 02:50 AM
Hello,
There seems to be another thread also interleaved with this one:
http://forums.ni.com/t5/LabVIEW/Error-with-data-sent-with-VISA-communication/m-p/2903834#M841892