LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select the specific channels attached to specific "create virtual channel"

Solved!
Go to solution

You are going to have major problems with that VI when you try to run it.  If someone clicks the wrong button at the wrong time, you are going to lock that VI up cold.

 

It is because you used multiple event structures,  and worse, they have events set to lock the front panel until the event completes.  Every event structure captures events even when it is not in the line of execution.  If you are in the wrong case of the case structure and fire a event in a different case's event structure, the front panel will lock, and you'll never have an opportunity to click something again to get you out of the current case.

 

Read Caveats and Recommendations when Using Events in LabVIEW then rewrite your program.

Message 11 of 35
(1,497 Views)

Dear Paul,

 

Could you show me how I should work with these attributes? 

I'm gonna try using the property node. But will I be able to select which waveform should show what channel?

 

I've attached my vi.

 

 

With kind regards,

 

Peter

0 Kudos
Message 12 of 35
(1,451 Views)

Dear RavensFan,

 

I've read about the event structures, but the major problem was that there was some code that wasn't in my event structure, right?

 

If you have the time, could you look at my program and tell me if the major problems are fixed now?

 

With kind regards,

 

Peter

0 Kudos
Message 13 of 35
(1,449 Views)

@PeteTheGod wrote:

Dear RavensFan,

 

I've read about the event structures, but the major problem was that there was some code that wasn't in my event structure, right?



I don't even know what you mean by that question.

 

But your most recently attached code still has the same problems.  Multiple event structures that will capture events and may get blocked from ever executing to handle the events they captured.

 

You need to rethink your architecture.  Get it down to 1 event structure.  It could be within a "Check User Events" case of a statemachine.  Be sure you'd go through that state on a regular basis to handle the events.  Don't have long running loops inside of any specific case of an event structure.

0 Kudos
Message 14 of 35
(1,430 Views)

@RavensFan wrote:

@PeteTheGod wrote:

Dear RavensFan,

 

I've read about the event structures, but the major problem was that there was some code that wasn't in my event structure, right?



I don't even know what you mean by that question.

 

But your most recently attached code still has the same problems.  Multiple event structures that will capture events and may get blocked from ever executing to handle the events they captured.

 

You need to rethink your architecture.  Get it down to 1 event structure.  It could be within a "Check User Events" case of a statemachine.  Be sure you'd go through that state on a regular basis to handle the events.  Don't have long running loops inside of any specific case of an event structure.


Pete, I think what you're missing is that you don't need the value to be read from within the event structure. The logic could follow something like this:

Code is in Idle state (where there's an event structure) > user presses button > code goes to ButtonPress state > values are read from inputs and values are used within ButtonPress state

 

You should really look in to re-creating your code using the State Machine architecture provided as a template by LabVIEW.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 15 of 35
(1,424 Views)

Dear,

 

Thank you for your reply. 

 

How can I get this down to 1 event structure? What do I need to do with the case structures and the tab control then?

I'm really a newbie at this, but I just need a program that reads the sensors that I attach, (randomly chosen how many of those sensors and on what channel), I should be able to zero them, and I should be able to show them seperatly per type of sensor in a graph. 

 

This is for my master thesis, but I don't know how to complete this program...

 

 

 

0 Kudos
Message 16 of 35
(1,417 Views)

If you just want to make it "work" then you don't need to make any big changes, you can just make sure the user (you?) never presses the wrong button.

 

If you want to get it down to one event structure, you create a case in your case structure named "Idle" that the application goes back to after (almost) every other case. The Idle case has your single event structure and waits for user input before going to the other cases.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 17 of 35
(1,403 Views)

Dear James,

 

With the state machine template you mean the simple state machine template? I'm gonna try working with that. 

 

With kind regards,

 

Peter

0 Kudos
Message 18 of 35
(1,357 Views)

Yup!

What year of LabVIEW are you using? I think 2013 and newer came shipped with an included template. If you click Create Project when LabVIEW first starts, you can select the Simple State Machine template as your starting point.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 19 of 35
(1,325 Views)

Thank you, 

 

I will try using this, but it doesn't seem to be easy as well...

 

I will keep you up to date.

 

Thanks for the help

 

with kind regards,

 

Peter

0 Kudos
Message 20 of 35
(1,311 Views)