LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI of rotary stage for big project

Hi

 

I got a stage using string commands. I used to make bad labview VI for convenience. no design pattern no sub VIs but spaghetti code.  Now my interviewer asks me to make a program for controlling the stage they provide. The basic commands include set zero, get position, go to position, jogging. I would like to give him a good impression, so I wonder if there is any good example for controlling a stage. It may contain a proper design pattern, standard sub VIs, and even the lvoop concept. This is for a big project of microscope using laser scan concept. I need a golden sample code for reference. Here I provide the product manual. I am not asking for solutions but I guess there may be a typical method for these kind of problems. Thank you.

 

http://www.sigma-koki.com/pages/support/motorize/manual_en/GSC-01_En.pdf

 

 

Jack

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

Jack,

 

does the vendor of this controller provide a "LabVIEW Instrument Driver"? If yes, work with it as it abstracts the commands you send by RS232.

If no, you should create yourself this library.

 

Next step is to create a software calling into the instrument driver in the correct order. A state machine sounds reasonable for this. Unless you require parallelism, this might also work for the rest of your project.

If you require a hard timing of the state machine execution, it might be necessary to pick a real time system. But i doubt that as RS232 isn't real time capable (it works under RT, but it doesn't provide determinism which means that accessing RS232 can break the determinism of code running on RT).

 

A more complex architecture would be a producer/consumer for simple parallel execution.

 

Both "patterns" can be reviewed by selecting those patterns in the template browser (File >> New).

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(3,096 Views)

@jack0529 wrote:

Hi

 

I got a stage using string commands. I used to make bad labview VI for convenience. no design pattern no sub VIs but spaghetti code.  Now my interviewer asks me to make a program for controlling the stage they provide. The basic commands include set zero, get position, go to position, jogging. I would like to give him a good impression, so I wonder if there is any good example for controlling a stage. It may contain a proper design pattern, standard sub VIs, and even the lvoop concept. This is for a big project of microscope using laser scan concept. I need a golden sample code for reference. Here I provide the product manual. I am not asking for solutions but I guess there may be a typical method for these kind of problems. Thank you.

 

http://www.sigma-koki.com/pages/support/motorize/manual_en/GSC-01_En.pdf

 

 

Jack


If the interviewer is asking you for a code example, you won't be able to fake it.  You may be able to copy code, but you will fall apart when this person starts asking you questions about it.  You'd better also hope this person doesn't visit the forums.  😉

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 3 of 5
(3,071 Views)
It's really helpful. Thanks! I made a sub-vi handle the commands. Then I made couple of sub-vi for different functions. Now I am working on the state machine. Thanks again!!!!
Norbert_B 已寫:

Jack,

 

does the vendor of this controller provide a "LabVIEW Instrument Driver"? If yes, work with it as it abstracts the commands you send by RS232.

If no, you should create yourself this library.

 

Next step is to create a software calling into the instrument driver in the correct order. A state machine sounds reasonable for this. Unless you require parallelism, this might also work for the rest of your project.

If you require a hard timing of the state machine execution, it might be necessary to pick a real time system. But i doubt that as RS232 isn't real time capable (it works under RT, but it doesn't provide determinism which means that accessing RS232 can break the determinism of code running on RT).

 

A more complex architecture would be a producer/consumer for simple parallel execution.

 

Both "patterns" can be reviewed by selecting those patterns in the template browser (File >> New).

 

Norbert




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

@jack0529 wrote:
It's really helpful. Thanks! I made a sub-vi handle the commands. Then I made couple of sub-vi for different functions. Now I am working on the state machine. Thanks again!!!!
Norbert_B 已寫:

Jack,

 

does the vendor of this controller provide a "LabVIEW Instrument Driver"? If yes, work with it as it abstracts the commands you send by RS232.

If no, you should create yourself this library.

 

Next step is to create a software calling into the instrument driver in the correct order. A state machine sounds reasonable for this. Unless you require parallelism, this might also work for the rest of your project.

If you require a hard timing of the state machine execution, it might be necessary to pick a real time system. But i doubt that as RS232 isn't real time capable (it works under RT, but it doesn't provide determinism which means that accessing RS232 can break the determinism of code running on RT).

 

A more complex architecture would be a producer/consumer for simple parallel execution.

 

Both "patterns" can be reviewed by selecting those patterns in the template browser (File >> New).

 

Norbert


Lazy programming habits bite you in the you-know-what eventually.  Please learn from this experince and just do it the right way all the time.


 

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,035 Views)