LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Proposed

Hello,I am a student and I have a project where I am instructed to do a game with labview.

I have searched for some posts and I found some that were very helpful and I learned while I was writing the code for different controls.

I am going to do an alleyway (the same game that is found on regular blackberry phones) 

I am going to post my code that I have done but  I am having difficulty identifying what I am doing wrong(programming is new to me)

Please help me do and solve the code.(my code is not complete)

 I know that I must have missed a very simple step(different from the rest of the undone project).

Thank you for your time.

 

 

Substitution 

0 Kudos
Message 1 of 3
(2,556 Views)

You have some very basic misunderstadings of dataflow. Did you really write this?

 

Your FOR loop willl finish after 2147483647 iterations (=~ never) and all further code (e.g. the while loop) depends on data from the FOR loop, and thus must wait until the FOR loop has finished. It will wait forever.

 

Also, the use of the local variables is incorrect and leads to race conditions. With every iteration of the FOR loop, it is impossible to tell what happens first: writing to the terminal (e.g. "x+y") and reading from the local variable of it feeding into the shift register. Most likely, the reading of the local variable occurs first. Eliminate the local variables and branch the wire going to the indicators so they also go where the local variabls are, then delete the locals. Also the up/down locals are not needed. Branch the green wire to both locations in the same structure.

 

Presumably, you want to read the up/dpwn controls during execution of the while loop. All UI parts need to be inside the while loop so the code reads them at regular intervals. (Once the FOR loop is complete, the up/down controls will never be read again).

 

Why don't you examine your code in execution highlighting mode? It will tell you immediately what the problem is. 😉

0 Kudos
Message 2 of 3
(2,528 Views)

Substitution wrote:

Hello,I am a student and I have a project where I am instructed to do a game with labview.


We now officially have an invasion. Smiley Very Happy

0 Kudos
Message 3 of 3
(2,508 Views)