LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital signal

Solved!
Go to solution

It will depend on how you control this system. If you need quick response then I would say that you need a producer consumer style. There was a lot going on in your code and I am right in the middle of upgrading to 2010. I will try and look at your code when I get done with the upgrade.

 

A state machine is also a great idea. I would do a mix of the two. You can see examples of that in the link that I sent earlier.

Tim
GHSP
0 Kudos
Message 11 of 36
(894 Views)

Here is a start. I am going to need to know a lot more about what you are doing inside this program to help with the program flow. Try and get the code to fit onto one window. I made some improvements. Get the code into one window and we go from there

Tim
GHSP
0 Kudos
Message 12 of 36
(887 Views)

NI should make a course called "The Value of Using Subvi's".  It is extremely difficult to follow a block diagram that is 2 monitors tall by 2 monitors wide. 

 

A lot of the functionality in the VI could be broken into subvi's, which would make the code much more readable and understandable.  Fixing problems would be much easier if the code was broken down to pieces.  You would be amazed at how much easier it would be. 

 

Even in text based languages, good programmers will use modules extensively.  Rarely would you ever find all the code in one module.  However, some C programmers go a bit too far and have modules buried 10 levels deep.

- tbob

Inventor of the WORM Global
0 Kudos
Message 13 of 36
(875 Views)

I started the state machine in the top loop. You will have to add a lot more function to get you where you need to go. I will help where I can. I gave some examples and help comments in the code.

Tim
GHSP
0 Kudos
Message 14 of 36
(868 Views)

Dear aeastet,

 

I'll take a good look at the VI you made and try to fill up the rest of the VI. Thanks a lot for helping me!

 

Regards,

 

Michael

0 Kudos
Message 15 of 36
(856 Views)

Dear aeastet,

 

I have attached a example of a state machine. Is this a good basis for the state machine for controlling the cylinders?

 

Regards,

 

Michael

Download All
0 Kudos
Message 16 of 36
(840 Views)

Did you look at the code that I gave you? There is a state machine in the top loop. It has some of what you are trying to do already. You just need to expand on it. If you have questions just pot them here.

Tim
GHSP
0 Kudos
Message 17 of 36
(833 Views)

May I make a suggestion?  I've noticed you duplicated the Selector function for the Stop button in almost every case.  You have had to create local variables and have had to make the mechanical action a switch type.  You can move this code after the case structure but before the shift register.  Then you would not need any locals, and you could keep the switch action as latch.  This makes the code just a tad simpler.

 

20855i31DB1E0CAAFE651A

- tbob

Inventor of the WORM Global
0 Kudos
Message 18 of 36
(828 Views)

Or you clould just look at the code that I started for yu.

Tim
GHSP
0 Kudos
Message 19 of 36
(824 Views)

The VI has been rebuilt. It's quite changed, but it works almost perfectly. The VI works for the small cylinder, but I don't know how to duplicate the while loop and the state machine in order to make it work for the big cylinder. Can you help me?

 

Regards,

 

Michael  

Download All
0 Kudos
Message 20 of 36
(780 Views)