LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Program distress stop for PCI Express 6343

Hello everybody,

 

I would like to implement a distress stop in my program. It should be something like that: I have an analog output. Now I send a signal over the analog output. For my board the signal is in an array. So now I press the distress stop. What I want know now is where my signal stopped in the array (as example by the value 10 in an array of 100 values)? That is the first question.

 

The second question is how can I stop the program without deleting the whole task? The sense behing is that I would like to shut down the system controlled. So when I press the distress stop the system shuts down from the point it is. I don't like to create a new task, find the old status, jump to this status and then shut down the system (DAQmxClearTask frees all reasources for the task that is not very good for my application)

 

Kind regards

 

 

 

0 Kudos
Message 1 of 14
(4,057 Views)

Hi,

 

I need some more information to answer your question.

You want to implement a distress stop in your program, but how should the whole system work?

Is the distress stop a element on the frontpanel or is it a machanical hardware switch connected to the 6343?

How do you ensure that the distress is really executed if the distress stop is only implemented in software?

 

The answer for the second question is to use the DAQmx function "DAQmx Stop" instead of DAQmxClearTask. DAQmxClearTask frees all reasources so that you have to recreate the whole configuration for the task. DAQmxStop only stops the task, but it doesn't free all reasources. You can start the task with DAQmxStart again, if you have stoped it with DAQmxStop.

 

Regards, Stephan

0 Kudos
Message 2 of 14
(4,013 Views)

Hello,

 

thank you for your answer. 🙂

To your questions. The distress stop is only in the software implemented. It is a button that can be pressed to stop the system. It is the first part for the saftey stop system that will implemented later with sensors who give back feedback to the software. At the moment it is only important to get the real status of the system when it stops.

Some more details: I generate a signal over a period of time (as example 10 min). My application generates not the whole array (example 800000 values would be the 10 min) instead it generates a specifed amount of data of the signal (example 5000 values). Then the data gets send into the device buffer. When the data arrives in the device buffer the next amount of data gets calculated (next 5000 values of the 800000 so in sum 10000 of 800000 are send into the device buffer already) and parallel the previous data gets send to the analog output. It is like a loop to have a low calucaltion time.

So the result is that my calculation is faster then the signal that will generated. (example: in my device buffer I have already 50000 samples but on the anloag output I am only by the sample 40000).

So now I press the stop-button. Now I would like to now where my signal at the moment is. So I search for the sample number 40000 and not the sample number that are written into the device buffer 50000.

I hope I have written that clearly enought 🙂

 

Best regards

0 Kudos
Message 3 of 14
(4,008 Views)

Hi,

 

thank you for the additional information. It now understand better, what du you want to accomplish

 

I would try somethink like this:

 

0) Configurate the DAQmx Task

1) DAQmxStart

2) Distress stop = True

       DAQmxStop (Instead of DAQmxClearTask)

     ELSE

        Generate Data

3) All Data Generated AND Task Done AND user wants to restart GOTO 1

 

You can try this DAQmx property to get the number of already generated samples:

 

Status:Total Samples Per Channel Generated Property - DAQmx - Data Acquisition VIs and Functions - National Instruments
http://zone.ni.com/reference/en-XX/help/370469AG-01/daqmxprop/attr192b/

 

This looks like the information which you are searching for.

 

Stephan

0 Kudos
Message 4 of 14
(4,003 Views)

Hello,

 

can you tell me where I can find the commands to the side you succested? I found that already before but I could not find the commands in LabWindows or a example to the commands.

 

Best regards

0 Kudos
Message 5 of 14
(4,001 Views)

I'm don't use LabWindows/CVI for my projects, but I could aslo find this property in LabWindows/CVI.

It seems to be part of the DAQmxGetWriteAttribute

Unbenannt.png

0 Kudos
Message 6 of 14
(3,998 Views)

Hello,

 

thank you for your help. I will try this and will report if it works.

 

Best regards

0 Kudos
Message 7 of 14
(3,980 Views)

Hello,

 

that is a litte bit of a stupid question but can you say me what I must fill in by the command? I got a lot of problems to find the right value for the "value"-field. It says I need a uInt64 in the help it says I need a float64 * or a void * so now I am a litte bit confused.

 

Best regards

0 Kudos
Message 8 of 14
(3,972 Views)

Good question. I don't know the right value for the value-field. I guess that you have to enter a pointer to a float64 number, so that the function have a location to store the value.

0 Kudos
Message 9 of 14
(3,967 Views)

Hm, it is a little bit weird.The program prototype is: DAQmxGetWriteAttribute

int32 DAQmxGetWriteAttribute (TaskHandle Task_Handle, int32 Attribute, void *Value, ...);

I tried first a void *value = 0.When I run the program I get the error you see in the following. So I assume that the command saves not a value there. But I have no idea. I didn't found a solution in the forum.

 

0 Kudos
Message 10 of 14
(3,964 Views)