LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to handle multiple serial communications

Hi guys,

I am in need of some help. I am trying to make a small program that does a few things:

 

1. Spin a stepper motor with no encoder (via serial RS-232) a set amount of time
2. Take a reading from a mitutoyo indicator (via another RS-232 serial)
3. Repeat N times.

 

I think that notifiers would do but I need some other opinions/solutions. I think that a state machine would benefit me here, which I am familiar with, but with multiple communcations going on, I am not sure the best way to achieve this. I have attached my VI, which I hate, and have stopped development on.

 

Any pointers would be greatly appreciated.

Eric

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

It looks to me like you have over complicated this.

 

A simple state machine is all you need. I do not think a producer-consumer (queue) is even needed here.

 

Also you are initializing your serial port every time you read? That is a problem.

 

I would have a state machine that does this.

  1. Initialize the serial ports and setup your document
  2. Start the stepper
  3. take readings
  4. save data
  5. stop the stepper
  6. repeat or exit
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(3,562 Views)

I appreciate the help. I think I have it but I want to keep this open if any other questions arise. Thanks again.

0 Kudos
Message 3 of 5
(3,524 Views)

Why dont you just make a linear VI?

0 Kudos
Message 4 of 5
(3,517 Views)

@Eric1977 wrote:

I appreciate the help. I think I have it but I want to keep this open if any other questions arise. Thanks again.


For the benefit of the forum, could you post your solution?  This is a help forum, and you could end up helping someone.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(3,504 Views)