LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

communicate by serial

 Hello,
I'am new with that prog and trying to implement a control with labwiew that does the following:
type a decimal number between 1-127
convert it to binary string, 1 byte .
send that byte via serial port with a few condition, like boud rate, time out etc.
recive from the instrument a confirmation string.
that is all about.

a few years ago i'v build the instrument and use a C program to do that....
now, i;m trying to make it up again with labview 8, at my work

thank u very much for replay

0 Kudos
Message 1 of 5
(3,209 Views)

Here's a very basic program for serial communciation. It uses the VISA functions for port configuration, write, and read. The numeric is converted to a string with a type case function. There are shipping examples that you can look at as well. You mihgt also want to use the VISA Bytes at Serial Port to determine exactly how many bytes are available if that varies.

Message Edited by Dennis Knutson on 12-25-2006 06:49 PM

0 Kudos
Message 2 of 5
(3,197 Views)
Thanks for replay...
as i mention, it is very new for me, all this function and yet, cant understand how it can work like that...
sorry for my english.
if i enter a decimal number, like 15, it must convert it to binary code, 8 bit = 00001111 and send it via serial port.
how this example do that ? (the convertion and the sending command).

are there any example to download and try ? ( didn't find what i need at the vi example )

i stuck in this project and you are my last hope, before going back to the C compiler...



0 Kudos
Message 3 of 5
(3,178 Views)
When working with communication functions in LV, the information is encoded as strings.
 
In Dennis' example, the function on the bottom (called Type Cast) takes the bit pattern of the I8 control and interpets it as a string (the pink wire) which is fed into a Write function, which sends the data to the serial port. My preference for generating the string is using the Byte Array to String function, which takes an array of bytes, but Dennis' method should work for your requirements.
 
To find examples, you should open the Help menu and select Find Examples.
 
This is all really relatively basic stuff. To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).

___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,166 Views)
Thank you !
i will follow the links......

What i'm trying to do is this:
i'v build transmiter and reciver depending on power line modem and micro controller...
it is going to be used for "smart home" project .
the computer will send the command by the serial port, to the transmiter (decimal) => the code will pass the power line while searching the reciver with the exact code (binary switch pin) and will change his stat.

i'v build the "boxes" and now trying to operate with LV.

hope i'm doing right....
any sugestion will be thankfull.....
0 Kudos
Message 5 of 5
(3,148 Views)