LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I make my vi's some control buttons response immediately?

Hi, I studied on a new vi which is capable of acquisition, control, and monitoring processes simultaneously. I prepared one in which state machine structure is utilized, but in this way, some control buttons (for example, stop button) that I want them to response immediately does not response. They wait for the loop timing. I know using event structure is a way but I am confused about using it. How can I adapt event structure to my code that is attached (looking the main vi is enough). And also, I am open comments about the program developments since I am not a professional user of labview. Thanks in advance.

Egemen
0 Kudos
Message 1 of 9
(2,458 Views)

Please try not to be offended I'm going to try to be brief and give you some pointers.

  1. use a project not a llb
  2. USE vi documentation and provide comments in your code  For instance that jpeg on the block diagram of "VSC.v0.SUB.Scaling_VSC.vi" is what?  or did you expect that picture of code to import like a snippet?
  3. DAQmx Tasks cannot mix analog in and analog out channels period.  That DAQmx Task will throw an error and not much is going to work.

On the plus side you seem to have a fair grasp of dataflow and there isn't much wrong with your understanding of what a state machine is.  I won't give you too many points for "Style" though!  Those bloated block diagrams really could use some work.

 

Look into the online training on "Producer Consumer (Events) pattern.  You are correct that that would be a better framework for your users.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 9
(2,444 Views)

thank your advices Jeff 🙂

 

Actually, I use project, I just save as llb to put my codes here regarding it is better.

 

About documentatio, you are right. I generally do not use it because for now only I used and prepared it. I have a notebook for explainations on my own, but, I will the required explanations in the block diagrams in the future that I will be convenient.

 

Yes, I have doubt about daqmx tasks for input and outputs. Thank you so much. I will separate these tasks.

 

I just prepared it and I have not tested it with devices yet. As you said, this code seems to me bloated too, that's why I asked advices  🙂

 

I have different versions of this vi based on producer/consumer but they put the data in a queue. I want it to acquire and analyze immediately. And they are a little complicated for me. I have to work on these a lot.

 

I appreciated you. If you want to give advices later, I will be open them all. Thank you again.

Egemen
0 Kudos
Message 3 of 9
(2,426 Views)

newbieeng wrote:

I have different versions of this vi based on producer/consumer but they put the data in a queue. I want it to acquire and analyze immediately. And they are a little complicated for me. I have to work on these a lot.


Then you acquire, but the data in a queue, dequeue and analyze in your parallel loop.  This will result in faster acquire and analyze than doing it serially.  Trust me, I know from a lot of experience.

Producer/Consumer (just in case you haven't read the document on Producer/Consumer)


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
0 Kudos
Message 4 of 9
(2,419 Views)

I have already coded one but I am not sure that it works that I desired. I attached it (A.MAIN PROGRAM_v2 is the main vi). I will try to code a new one again. Thx.

Egemen
0 Kudos
Message 5 of 9
(2,407 Views)

Its unfortunate that you do not have LabVIEW 2013 since the project templates can be very good starting points to set up some of these projects.  However! the documantation is available and the developer walkthroughs can really clairify how the patterns work.

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 9
(2,403 Views)

Your problem is that you have a data dependency between the two loops (2 wires going from producer loop to the consumer loop).  You need to change your queue data type to include this data with the sample data (hint: use a cluster).  That will remove the data dependency and allow the two loops to run at the same time.


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
0 Kudos
Message 7 of 9
(2,398 Views)

There is two data coming from the producer loop to the consumer onw which are time and second data. I used it to record exact date and time of acquired data. I thought that if I used time function at consumer loop it does record the analysis time in order to exact time of acquired data. Do you mean that with data dependency?

Egemen
0 Kudos
Message 8 of 9
(2,386 Views)

I prepared this producer/consumer vi once upon a time but I do not remember whether it works or not. Could you take a look at that one and give me advices on it? Did I do it in the right way?

Egemen
0 Kudos
Message 9 of 9
(2,377 Views)