LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Please help by checking over my Quartzdyne Px/Tx code

Hi its been a few years since i have used Labview, and even then i was only at a beginner level.

I would very much appreciate it if someone could check over my code and comment. I have no way of testing it at this stage, you see.

 

I anticipate there being a few things wrong with it; I’m wondering if i have coded the 4 sensors appropriately for communication on the Serial interface, for example??

 

Many thanks  

 

LN 

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

First it the use of Stacked Sequence Structure.  You need to learn to avoid it as soon as possible.  Others may claim that I'm on an anti-SSeq bandwagon, and they are right.  In my opinion, the use of Stacked Sequences is a bad approach to LabVIEW programming, as it is not scalable and may lead to potential errors due to potentially a lack of dataflow that I will mention below.

 

Output of VISA Configure Serial Port and the error out should be wired to VISA Write.  This is already an example of broken dataflow, or actually broken data.  If you had an error at the VISA Configure Serial Port, it would not be captured.   As a matter of fact, your error cluster is broken at every sequence. 

 

Same story about your VISA Reference, which is broken at every sequence.  Breaking dataflow may cause headaches when trying to debug your code.

 

How do you know how many bytes to read at the serial port?  Maybe there is no data..

 

Your loops will never stop unless you click on stop before running your VI.  You need to provide a means of reading the value of STOP after you have started your program, or rather, while it is executing the while loops.  I changed the mechanical action to switch when released so that you can get something running for now. 

 

Do you realize that you are constantly sending data and reading from all 4 loops?  Do you think that is wise?  What about collision?  You may be flooding the serial port with data being transmitted all at once.  I did not change that portion because I do not know your intentions.

 

 

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

I forgot to attach the code

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