LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending message on RS232 with interval 1 ms

Hi there, 

 

I´m using the RS232 to communicate to a motor. The Baud rate is 19200, 8 data bits, 1 stop bit, no parity.

A requirement of the motor is between each byte there should be an interval of 1 ms.

How can I set the interval in LabVIEW?

 

Thx 

0 Kudos
Message 1 of 9
(3,998 Views)

Hi wilburwu,

  Place a while loop and paste a wiat until next millisecond multiple VI and wire it with a constant 1 or else place  a timed while loop..For more details got through the examples.

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 9
(3,980 Views)

and to check your time interval is working ok, go to Tools > Profile > VI metrics and check that your vi's time isn't larger than 1ms.

In my opinion, try to reconsider your time interval into 10ms...

 

 Another way to do it is using a timed while loop. and make sure to check the (finished late? output)

0 Kudos
Message 3 of 9
(3,970 Views)

I'm not sure you can really control that with labview. Almost sounds like you would need to embed gaps into your data that is transmitted. I sure don't think you could guarantee 1ms based on windows repsonse time unless it is built into the serial port hardware. Could you provide some more info on the motor part numbers and communications specification? If you have some demo software for the device, use portmon to monitor that piece of software. Then write labview code to match it.

0 Kudos
Message 4 of 9
(3,966 Views)

I think there are some misunderstandings in some of these answers. I'm pretty certain that what the op is asking for is the same thing as the character delay setting in Hyperterminal. The delay is a minimum and what has always worked for me is the simple code below. To add line delay, place a Delay function outside the loop to be executed after the while loop finishes.

 

Message Edited by Dennis Knutson on 03-19-2010 09:06 AM
Message 5 of 9
(3,931 Views)
Dennis, just out of curiosity, why do you have the loop stop if the number if iterations is less than the length of the string?
Cory K
0 Kudos
Message 6 of 9
(3,908 Views)

Cory,

 

Look closely: The input to the OR function has an inversion circle.

 

Lynn 

Message 7 of 9
(3,903 Views)
If the requirement is a hard, realtime requirement (characters sent at exactly 1 ms between characters) then you can't do this with an application running on a PC. You would need a realtime system to do that. If on the other hand you need what Dennis suggested, a minimum of 1 ms between characters then what Dennis posted would work fine for you.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 9
(3,887 Views)

johnsold wrote:

Cory,

 

Look closely: The input to the OR function has an inversion circle.

 

Lynn 


Thanks Lynn, I didnt catch that.

Cory K
0 Kudos
Message 9 of 9
(3,858 Views)