08-13-2010 05:59 AM
Hello All,
I am a beginner in Labview and need some assistance on the below:
I want to create an interactive console application with Labview to communicate over RS 232. The GUI should allow me to
1. Send some specific commands over RS 232. (This I guess I will be able to do if I get a base application).
2. Receive 16 bit data over RS 232 and log it to a file. (This I guess will be tricky as RS 232 is 8 bit communication standard and the application like windows Hyperterminal will interpret 16 bit data as 2 8 bit ascii characters, which I dont want)
Let me know any thoughts on how to go ahead.,
Thanks so much,
Nagaraj Hegde
08-13-2010 07:23 AM
go to the help in the toolbar, select Search For Labview Help. Then do a search for Unflatten From String Function. Look at the examples for this function. Remember to set the correct endian format (Google endian if you do not know what it is).
Post again if you need more help. In Labview you can do this in many ways. Some prefer to just use the type cast function.
08-13-2010 10:49 AM
Hello Coq,
Thanks for your reply.,
I got this example Basic Serial Write and Read.vi in the example finder but when I tried executing, I got the error message as attached. Can you kindly help me out by guiding me how to resolve that. Where can I get the VISA? I am evaluating Labview and don't have any other drivers with me,.
Thanks again,
-Nagaraj Hegde
08-13-2010 11:11 AM
My guess is that you do not have any VISA driver installed. You will find the VISA driver here for for download http://sine.ni.com/psp/app/doc/p/id/psp-411
08-18-2010 04:01 AM
Hello Rouge,
I downloaded the Visa driver from the link you provided but now getting the error as attached., Kindly let me know if you have any idea about this.,
Thanks for your help.,
- Nagaraj Hegde
08-18-2010 05:21 AM
Hello Rouge,
I think I got the solution for this, the installer had got saved as some other name.,
Thanks and best regards,
Nagaraj Hegde
08-18-2010 12:46 PM
Hello Rouge,
Now I have got the drivers installed and able to run the Basic Serial Write and Read.vi. I need a help at this point., Can you plz tell me how to look at the source blocks of these examples? I need to modify them to suit my requirement., Basiaclly I want to read the incoming data from the serial port as 16 bit data., The operations you suggested initially ll help I believe, but to do that I need to alter the source blocks., Let me know if you have any hint how to do that.,
- Nagaraj Hegde
08-18-2010 12:49 PM
I don't understand what you mean by "source block".
Serial data generally consists of bytes that have 8 data bits. Sometimes they might be 7 bit data. (5 and 6 bit are also possible, but not very common.)
If you have a device sending "16 bit" data, it is sending two 8-bit bytes. You need to read two bytes, then use the numeric conversion functions and data manipulation functions to do things like Join the two 8-bit bytes into a single 16-bit word.
08-18-2010 12:56 PM
@Ravens Fan wrote:
If you have a device sending "16 bit" data, it is sending two 8-bit bytes. You need to read two bytes, then use the numeric conversion functions and data manipulation functions to do things like Join the two 8-bit bytes into a single 16-bit word.
Ravens Fan points you in the right direction. The Join Numbers function will form a 16-bit word from two 8-bit bytes. However, you need to know which byte is the most significant (big endian or little endian). If you don't put the bytes in the correct order, you will get the wrong 16-bit word. Your endpoint device manual should specify the format it is using.
08-19-2010 04:30 AM
Hello,
Thanks for the replies.,
My device sends Lower byte first : for example : if I send 0x5658 what I will recieve in the console is XV (ascii of 0x58 is X and 0x56 is V). I am able to make changes to the basic serial write and read vi to log the data in a file but I want to log as 0x5658.,
Can you kindly elaborate on your suggestions ("which numeric conversion and data manipulation functions and how to use") as I am new to labview?
Thanks for your help again;
- Nagaraj Hegde