Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically determine if the SCXI chassis is turned on

Is there a way to do this in NI-DAQmx using the C libraries?  (The only samples I've found are for labview, and using traditional NI-DAQ, so useless on both counts Smiley Happy)
 
I'm using NI-DAQmx 8.0, with the SCXI 1000 chassis.
 
Thanks for your help.
 
John
0 Kudos
Message 1 of 8
(4,787 Views)

Hi John,

There is not an exsisting library function that returns the chassis power status. However, you could use error handling to try and ascertain the power status - if the chassis is not powered it will return errors which you could pick up on.

Can you tell me why you want to determine the chassis power state programmatically?

Regards,

Emma Rogulska

NIUK & Ireland

0 Kudos
Message 2 of 8
(4,776 Views)
Sorry for the delay responding - I have been away from the office:
 
The reason for the request is that I need to make sure the chassis is turned on before I try to run it - at the moment, the following code does not throw an error if the chassis is not on:
 
 error = DAQmxLoadTask( taskName , &taskHandle );
 if(DAQmxFailed(error)) //an error has occurred, throw this back
  throw DAQError(error);
 
I need to know if the chassis is on or off, so that I can inform the user that it needs to be turn on, otherwise the readings are meaningless!
 
Regards,
John
0 Kudos
Message 3 of 8
(4,736 Views)

Hi John,

I'm afraid I don't understand why if you have a user with the chassis, why you can't just have them make sure it's on before you try to run each time? As if you did programmatically find it was off you would have to get them to switch it on anyway... As I said there is not an existing library function.

Another option would be to monitor the power line of the chassis but this is not simple solution.

Regards
Emma Rogulska
NIUK & Ireland

0 Kudos
Message 4 of 8
(4,735 Views)
The chassis is going to be in a crate as part of a larger solution - it will not be immediately visible to the user, or easily accessible.

So, if the power cable were to become disconnected, it were to fuse out, etc., etc., etc. it would not be immediately obvious as to why the process failed. It is possible to access the box if needed, but this is not the only error that can take place in the program (others relate to non-NI issues)

I just wanted to be able to tell the user why it had failed so that the appropriate action can be taken, as I have with all the other points of failure in the system.

You mentioned in your first post that I could check for errors - can you explain why the code I posted above does not throw the error?

Or can you tell me what you meant?

Thanks,
John
0 Kudos
Message 5 of 8
(4,731 Views)

Hi John,

Thank you for clarifying the context of the chassis within your application.

The reason that your code is not producing an error is that it is only loading the task, if you were trying to write or read from the task it would prompt an error.

In order to suggest appropriate error handling for your chassis can you tell me what device you are using to communicate to your chassis? - Is it an NI DAQ card within a PC? If so which? And what modules do you have within the chassis? - I can then perhaps even give you error handling that will tell you if an individual module stops working.

Also what software are you using to communicate/control your application? Version?
I am guessing that your error handling has to be done in C?

Regards

Emma Rogulska
Applications Engineer
NIUK & Ireland

0 Kudos
Message 6 of 8
(4,719 Views)
Hi Emma,
 
Using an NI PCI 6221 within a PC.  Using an SCXI 1000 chassis with two SCXI 1102/B modules
 
Using Visual C++ 6 to code (using the NI ANSI C Dev libraries) to control it - this is where error handling has to take place.
 
Thanks eversomuch for the help, and sorry for not being clearer earlier on
 
Regards,
John
0 Kudos
Message 7 of 8
(4,715 Views)

Hi John,

I believe you should be able to check whether your chassis is powered and working correctly using the DAQmxTaskControl function.
There is a full description of this function, it's capabilities and value options in the NI DAQmx C Reference Help.

The NI DAQmx C Reference Help should be on your PC at the following location:
"Start" > "All Programs" > "National Instruments" folder > "NI DAQ" > " NI DAQmx C Reference Help".

This should open up a window. Go to the contents tab and expand the following tree structure nodes:
DAQmx C Functions > Task Configuration/Control > Advanced > DAQmx Task Control.

I would suggest using DAQmx_Val_Task_Commit valu. I tested this by creating an configuring a ficticious SCXI chassis containing 1102B modules and attached to thermistors. I then created a task for the modules and ran it with the DAQmx Task control, with value Task Commit, after which I placed a simple error handler configured to display any errors in a pop-up box.

As I do not actually have the hardware it was the same as if the hardware were present and not powered.

When I ran my code it prompted the following message: "Error -200073 occured at DAQmx Control Task, SCXI module specified in the hardware configuration was not found.
Make sure that the SCXI chassis is powered on, the SCXI cable is properly connected between the chassis communicator and the SCXI module, and that the cabled module specified in the hardware configuration is present in the specified slot.
SCXI Module: SC1Mod1"

I hope that this helps you.
Let me know how you get on,

Regards

Emma Rogulska
Applications Engineer
NIUK & Ireland

0 Kudos
Message 8 of 8
(4,715 Views)