01-27-2011 03:51 AM
Hi! Im new to labview and need to use it now..i need to make a program to send some data randomly and continuously to another program
can someone show me how to do it?
for example i want to send Msg ID= 0x00000001 and Data= 0x00000010, Msg ID= 0x00000002 Data= 0x00000020 and so on..
how do i make a program that generate and sent this kind of data continuously and randomly through serial connection
01-27-2011 04:04 AM
Look st the serial comms examples that ship with LabVIEW.
I once wrote a program that was randomly sending data, was not intentional though
Rgs,
Lucither.
01-27-2011 04:19 AM
the basic serial write and read.vi dont have function that will automatically generated and send the data..we must write the data ourself and send it right?
i need to modify the program so it can generate such kind of data and transmit it to another read.vi
did u have the program that u said just now?can u upload it here so i can make some review
01-27-2011 04:47 AM
Hi Icy,
The normal way to go about it is by actually trying to learn how to program using LabVIEW. Post some code of your attempts and people will point you in the right direction. Just coming on a forum and asking people to write some code for you because you need it and dont know what you are doing is a bit lazy, at least have a go. As i said, there are examples using how to communicate through serial. There are also plenty of free tutorials on NI's website, if you use the free information thats out there you will easily be able to accomplish your task. If you just want someone to write it for you i suggest you try the jobs board.
Rgs,
Lucither.
01-27-2011 04:57 AM
01-27-2011 07:09 AM
how do i change this vi. so that i have the maximum value 0x00000200 and minimum is 0x00000000
01-27-2011 07:10 AM
how do i change this vi. so that i have the maximum value 0x00000200 and minimum is 0x00000000
01-27-2011 07:29 AM
Hi Icy,
The attached will give you a random number between 0 - 200 hex, 0 - 512 decimal. In the example i have sent and what you have asked for it is 0 padded to give a length of 8 digits, why is this? Even though in my example it shows the value like you have asked if you were going to send it, it would still be sent as a maximum of decimal 512, only needing 2 bytes. Is the message length you need to send 4 bytes long, accounting for the padded 0's. If so do you know how to split up the number to be sent as individual bytes?
Rgs,
Lucither.
01-27-2011 08:00 AM
Hi Icy,
As discussed earlier, if you need to send 4 bytes as a message, which i am assuming from the 0 padded example you wanted then i have attached how to split the data you need to send into individual bytes. If i have mis-understood (which is likely as its late here and im well into the brandies) then ignore it.
If you need to know how to display the numbers in the hex format with the 0 padding just look into the properties of how i have configured the indicators, under display format. No matter how you display it though the same data is always sent.
Rgs,
Lucither
01-27-2011 10:24 AM
ouh sorry i forget to mention..dont worry about the bytes..i just make it as example and will change it later according to what i need
i've make it to two random generated now..and now how i can combine this vi. with basic serial write and read so the random generated value can be send to another basic serial write and read?