From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

code working when highlight execution is on and not able to display and save data without it, kindly help me resolve this issue.

code working when highlight execution is on and not able to display and save data without it, kindly help me resolve this issue.

Chirag134_0-1627539433452.pngChirag134_1-1627539450566.png

 

0 Kudos
Message 1 of 5
(902 Views)

When your "Read" button is off (false), you loop spins very fast, writing lots of zeros to the chart, and empty strings to the file.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 5
(874 Views)

Dear Paul,

 

Thank you for your reply.

I have replaced the "Read" button with always true then; also, it is not able to save data.

 

Waiting for your help.

 

With Regards,

Chirag

0 Kudos
Message 3 of 5
(842 Views)

@Chirag134 wrote:

Dear Paul,

 

Thank you for your reply.

I have replaced the "Read" button with always true then; also, it is not able to save data.

 

Waiting for your help.

 

With Regards,

Chirag


Don't be lazy.  Turn on highlighting and do your own debugging.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 5
(823 Views)

Programming in LabVIEW requires basic understanding of dataflow and simple functions. I would recommend to start with some basic tutorials listed on the top of the forum. 

 

  • First the difference between regular run and highlight execution is timing. One runs much faster. In your case you have no timing, so the loop rate determines exclusively on reading the instrument if "read" is TRUE or determined by the computer power if read is FALSE (probably millions of times per second!)
  • A readable and maintainable program has wires going from left to right, not randomly in all directions.
  • Learn the meaning of output tunnels set to "use default if unwired". Your use of them makes no sense. For example if any of the case structures ever turn FASE during run, the VISA resource held in the shift register is irreversibly lost forever until the program is restarted from scratch..
  • Using "from dynamic data" to convert a scalar to an array is just plain silly.
  • Shouldn't your pink shift register be initialized? Currently it will contain ever-growing data from all previous runs.
  • All these single height "built array" and the "insert into array" is a bewildering way to create an array with three elements. You can do the same with 20% of that code. (see picture below)
  • If you would pace the loop at a known rate, you can set dx of the chart accordingly and just chart the scalar value, substituting NaN if "read" is off". Not sure why you also want to log empty strings.
  • many more problems! ...

 

altenbach_0-1627835647671.png

 

0 Kudos
Message 5 of 5
(802 Views)