LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simple project on serail port

Hello:
I need some help on writing a labview program that will use the serial port to
send the data. I need the program to send a specific sequence of bits to the
serial port at a rate of say eg:50ms per bit. Because it will be stored to a
shift register with one input hence I will need to clock the registers with the
serial port and start send data at a constant rate inorder for me to store the
values in the register for a test procedure. Is there a vi availabe that I can
do this or I need to program it?

Thanks
Peter
0 Kudos
Message 1 of 7
(3,557 Views)
Hi Peter,

If your numbers are acurate i.e. 50ms/bit, you are talking about transmitting at 2 baud!

The slowest I have seen a serial port run at was about 30 or 60 baud and was used for the old mechanical teletypes (asr-33's).

If this is really the case, then the serial port may not do what you want.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 7
(3,557 Views)
It sounds like you want to synchronize your 'data send' to a specific clock rate. If you don't have a direct hard-wired clock/trigger that controls the board, then you could put your 'send' vi in the True state of a Case structure, and when ever you send a True to the Case the vi inside will execute the send. The key then is to determine when to send the True. I have used this mode for a 10pps rate by simply using the 'Wait until next ms Multiple' VI set at 100 ms. If you try this method, you want to minimize the functions inside the True Case, such as don't put any initializing of ports in there - do that in an earlier sequence. Just an idea, good luck with it, Doug
0 Kudos
Message 3 of 7
(3,557 Views)
It sounds like you want to synchronize your 'data send' to a specific clock rate. If you don't have a direct hard-wired clock/trigger that controls the board, then you could put your 'send' vi in the True state of a Case structure, and when ever you send a True to the Case the vi inside will execute the send. The key then is to determine when to send the True. I have used this mode for a 10pps rate by simply using the 'Wait until next ms Multiple' VI set at 100 ms. If you try this method, you want to minimize the functions inside the True Case, such as don't put any initializing of ports in there - do that in an earlier sequence. Just an idea, good luck with it, Doug
0 Kudos
Message 4 of 7
(3,557 Views)
"Doug (CapeFl)" wrote in message news:<50650000000500000074370000-993342863000@exchange.ni.com>...
> It sounds like you want to synchronize your 'data send' to a specific
> clock rate. If you don't have a direct hard-wired clock/trigger that
> controls the board, then you could put your 'send' vi in the True
> state of a Case structure, and when ever you send a True to the Case
> the vi inside will execute the send. The key then is to determine
> when to send the True. I have used this mode for a 10pps rate by
> simply using the 'Wait until next ms Multiple' VI set at 100 ms. If
> you try this method, you want to minimize the functions inside the
> True Case, such as don't put any initializing of ports in there - do
> that in an earlier
sequence. Just an idea, good luck with it, Doug

Hello Doung:
This is a pretty good approach but how do I send this rate to the
clocks of my shift registers. Actually I can write it at any rate I
can, but I just need to sync the data I wirte to the shift registers.
I was thinking if there is a clock signal from the serial port, if yes
what rate will it be and I can put this into the way that you did, or
will it be too fast?

Thanks
Peter
0 Kudos
Message 5 of 7
(3,557 Views)
I posted new answer for an attachment vi.
0 Kudos
Message 7 of 7
(3,557 Views)
Peter, I'm attaching a 'rough/demo' vi to give a small example, but its timing accuracy also depends on your OS and the other functions going on at the same time. Doug
0 Kudos
Message 6 of 7
(3,557 Views)