LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital signal

Solved!
Go to solution

Dear,

 

I am working on a test stand that will be used for fatigue tests for a suspension, chassis etc. De vehicle components will be charged by hydraulic cylinders. These hydraulic cylinders are controlled by an AO and DO module (NI9263 & NI9401). Feedback is given by load cells. These load cells are connected with AI module (NI9201).

 

When a cylinder reaches a certain force (certain amplitude load cell NI9201) the cylinders stops pulling and will make an outward movement. This signal is 0 when outgoing and 1 when certain force is reached. A green led starts to burn (signal is 1) when the force is reached. When the force is zero (close to zero) another signal is sent out. Another green led starts to burn. Now I want the cylinder to make an outgoing movement until the force is zero (close to zero).

 

The problem is that when the cylinder makes an outgoing movement and as soon the force is a little under the maximum force (signal green led is 0) the cylinder will immediately go back in. I want the cylinder to wait until the force is zero (signal is true for green led negative peak) and then go back in. I have tried to make several case structures but I didn't manage to make it work. Can you help me?

 

Kind regards,

 

Michael Tielemans

 

PS: see attached VI

0 Kudos
Message 1 of 36
(3,697 Views)

Well you have gotten to where you are going to need a more complex programming style. I would look at the produce consumer arcetechure and state machine examples. You also need to get rid of the DAQ assistances and learn how to really program LabVIEW. You are going to start hitting wall with what you are currently trying.

Tim
GHSP
0 Kudos
Message 2 of 36
(3,663 Views)

Tell me about it. I was afraid I had to change everything. The problem is that I have little experience with LabVIEW. I'm just a rookie. Can you give me an example how to begin cleaning this ''mess'' up?

 

Regards,

 

Michael Tielemans

 

 

0 Kudos
Message 3 of 36
(3,652 Views)

 


@T_Mike wrote:

Tell me about it. I was afraid I had to change everything. The problem is that I have little experience with LabVIEW. I'm just a rookie. Can you give me an example how to begin cleaning this ''mess'' up?

 

Regards,

 

Michael Tielemans

 

 


 

Take a look at the examples that ship with LabVIEW. If you look up Producer Comsumer you should see the examples there. Try to put something together and I will help from there. You need to at least try to do something. I will be happy to help once you have put a little effort into the change. I have a full time job and try to get on here as much as possible but I do not have the time at this moment to try and send code for you to look at.

 

Here is a thread where I helped someone put together something like this. Take a look at the evolution of the code and start with that.

 

http://forums.ni.com/t5/LabVIEW/There-must-be-a-better-way-of-doing-this/td-p/1165913

 

Tim
GHSP
0 Kudos
Message 4 of 36
(3,634 Views)

It would also help if you translated all the labels to English.  Put comments inside your code to explain what you are doing.  Also, put a delay, Wait(ms), inside the loop to avoid using 100% CPU time.

If you explain what the code does, we could suggest improvements.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 36
(3,628 Views)

Thanks guys,

 

I'm going to work right away.

 

Regards,

 

Michael

0 Kudos
Message 6 of 36
(3,611 Views)

Guys,

 

I have cleaned up my VI, but I'm still struggling with rewriting the old VI. I'm trying to put the old VI into a producer/consumer design pattern (events), but I really don't know where to start. You said I have to get rid of the DAQ Assistants, but with what do I have to replace them?

 

aeastet: I also studied ''There must be a better way of doing this''. The signals of the load cells are the producer and the Analog Out & Digital Out signals to the valves of the hydraulic cylinders are the consumer. Do I have to write the signals of the load cells to an array? The data of the load cells also needs to be written to an Excel file and when a certain peak is reached a digital signal must be send out to the valves. I really need a little push in the right direction.

 

Regards,

 

Michael

Download All
Message 7 of 36
(3,589 Views)

 


aeastet: I also studied ''There must be a better way of doing this''. The signals of the load cells are the producer and the Analog Out & Digital Out signals to the valves of the hydraulic cylinders are the consumer. Do I have to write the signals of the load cells to an array? The data of the load cells also needs to be written to an Excel file and when a certain peak is reached a digital signal must be send out to the valves. I really need a little push in the right direction.

 

Regards,

 

Michael


 

You do not have to write these values to an array. It really depends on what you are looking to do with your data. You could also put the data into a graph, and event, a shift register (you will need to be careful with this option) and a queue just to name a few ways that you can handle the data.

 

I will try and take a look at your code a little later today and see what I can do to help.

Tim
GHSP
0 Kudos
Message 8 of 36
(3,578 Views)

The data of the load cells is used for controlling the valves of the hydraulic cylinders. A positive or negative peak in the data (this corresponds with an analog amplitude of the load cells) must prevend the cylinders of destroying certain components. With this data the cylinders will make either a starting or an outgoing motion (pull or push load). The data of the load cells also has to be written to an Excel file so that I can see what happened at what force.

 

Regards,

 

Michael

0 Kudos
Message 9 of 36
(3,573 Views)

aeastet: I also had contact with a Dutch applications engineer from NI. He said that a producer/consumer pattern is not at it's place, because this pattern is commonly used for high speed data acquisition. My application is used for measuring certain values (forces) and sending out signals (analog and digital). He suggested to use a state machine pattern (I believe you mentioned that too). I'm going to determine the most important hardware inputs and outputs and front panel inputs. Then I'm going to 'build' my states:

 

initial state (determine parameters: cycles, force, delay)

open state (cylinder makes an outward movement)

close state (cylinder makes a pulling movement)

 

I will keep you up to date of the progress.

 

Regards,

 

Michael

 

0 Kudos
Message 10 of 36
(3,560 Views)