LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i design a system to count responses before it moves on to the next cycle??

I have two VI's that seperately work perfect, but combined not so much.  The first VI uses USB-6009 to control pneumatics using digital outputs.  There are 12 cylinders in 4 banks of 3.  The second VI uses can messages to accurately show which buttons have been pressed.  I want to have the program push the first 3 buttons, wait for the can response, then move on to the next back of cylinders.  The reason for this is to track errors when something goes wrong.  Also, any suggestions on why it runs so slow?  I have to speed it up cause it misses a bunch of the messages, but like i said by itself it works great.   I have attached a combo VI with both of the VI's i have mentioned.  Any suggestions will be much appreciated.  Thanks guys

0 Kudos
Message 1 of 5
(2,491 Views)

 


@chris12345 wrote:

I have attached a combo VI with both of the VI's i have mentioned. 


Try again. Your attachment did not make it.....

 

0 Kudos
Message 2 of 5
(2,480 Views)

Sorry here it is again

0 Kudos
Message 3 of 5
(2,477 Views)

Sorry, I don't have any DAQ installed, so I cannot look at your assistants.

 

Some problems after glancing at the code for five seconds:

 

 

  • Your error shift register is not initialized, meaning if the run ends in an error, it will start with an error the next time you run it. This is probably not desirable.
  • There seems to be a lot of code duplication. The upper part could be done in a inner FOR loop, autoindexing over arrays of booleans with 5 elements (or rows)..
  • Why do you configure the serial port with every iteration of the FOR loop, even in cases you close it a nanosecond later without even using it. Typically you would configure it once before the loop, read (or not) inside the loop, then close the session after the loop has completed.
  • The program does not look complete. Currently it is unidirectional and basically non-intereactive. Shouldn't there be a state machine around it for example?

 

0 Kudos
Message 4 of 5
(2,462 Views)

Thanks i will definately take the configuring of the resource.  I havent spent much time with LabVIEW and not really sure what some of what u said meant.  But ill fix what i can and if you dont mind take another look at it later.  Im thinking about using a "for loop as the main loop" with a stacked structure inside to place in the daq assistants.  Im just not sure how to tell it to read in between each bank of cylinders.

0 Kudos
Message 5 of 5
(2,451 Views)