LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Losing Data Using VISA

Solved!
Go to solution

So, at the port "byte count" of VISA Read, I should put a constant with a number greater than the longest message I ever expect to receive? But, what do I put at the case selector just outside this VISA Read?

 

Another thing, I think this wasn't happening before, but the clear plot for the Temperature Graph isn't working. When I press it, the program stops running, but the clear plot for the power measurements graph is working perfectly, and they are implemented equally.

 

The last thing, is the VISA Close implemented correctly? Because there are cases where the serial port isn't closed.

0 Kudos
Message 11 of 15
(695 Views)

First let me introduce you to the plot visibility checkbox 

Capture.png

That will remove a whole bunch of code you don't need and make the UI a lot better behaved.

crossrulz clued you in on that already 

Next I'll introduce you to

Capture.pngfrom the C:\Program Files (x86)\National Instruments\LabVIEW 2016\vi.lib\AdvancedString\  folder.  you can use VIPM to instal "Hidden Gems" and have some of these really nice utilities right on your palettes. 

 

Then: You have one (1) Stop button labeled "[ESC]" and three event structures registered for the Value Change Event.  When do you think the event will enqueue?  (Every Press of the [ESC] button enqueues a VC event for each structure registered for the event - even if the event structure cannot yet execute! so, as soon as you press ESC the first time all event structures have that event ready to go!)  THIS IS A PROBLEM.

 

 


"Should be" isn't "Is" -Jay
Message 12 of 15
(689 Views)

@CastroPedro wrote:

So, at the port "byte count" of VISA Read, I should put a constant with a number greater than the longest message I ever expect to receive? But, what do I put at the case selector just outside this VISA Read?


You remove it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 15
(670 Views)

Hi,

Sorry for the delay. I was really busy with other projects.

 

So I made the changes you suggested, and I think it's working now!! 

 

Thanks really much!

 

Is there anything else I should change in this program? Is the VISA close implemented correctly?

0 Kudos
Message 14 of 15
(644 Views)

@CastroPedro wrote:

Hi,

Sorry for the delay. I was really busy with other projects.

 

So I made the changes you suggested, and I think it's working now!! 

 

Thanks really much!

 

Is there anything else I should change in this program? 


Yes,  Please look at the "Producer Consumer (Events) pattern."  You can find that from Menu>> Files>>New... Design patterns.  

 

You may have tried to "Re-invent" a wheel that has been worked out to be much rounder than your attempt.  (Look, I tried to do it too, back when I was making every mistake you could make to learn some stuff about software design - I'm still learning)


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 15
(414 Views)