LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a program randomly send data

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

0 Kudos
Message 1 of 11
(3,890 Views)

Look st the serial comms examples that ship with LabVIEW.

 

I once wrote a program that was randomly sending data, was not intentional thoughSmiley Tongue

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 2 of 11
(3,882 Views)

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

0 Kudos
Message 3 of 11
(3,878 Views)

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.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 4 of 11
(3,868 Views)

Hi icycool,

  Possibly you can use random number generator function,do some manipulation and use it..Before that please post your code.

 

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 5 of 11
(3,864 Views)

how do i change this vi. so that i have the maximum value 0x00000200 and minimum is 0x00000000

0 Kudos
Message 6 of 11
(3,847 Views)

how do i change this vi. so that i have the maximum value 0x00000200 and minimum is 0x00000000

0 Kudos
Message 7 of 11
(3,846 Views)

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.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 8 of 11
(3,840 Views)

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

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 9 of 11
(3,824 Views)

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?

 

Download All
0 Kudos
Message 10 of 11
(3,804 Views)