LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System flags - Labview 2009

Hello,

 

I developed a labview application for my costumer and he is satisfied, for now :aie:

 

 

Well, he asked for something to add to this application : flags !

he need to know if his server where I installed the labview application is "going okay" 😕

 

I explain more : He want to know :

- is the HDD is okay ? (bad sectors, temperature, speed, ...) so he can change it before beeing damaged.

- is the server (PC) okay ? (Temperature)

- is the RAM okay ?

- ..... other indicators if possible with labview

 

So my question is : what can I read using my labview application ? (server temperature ? bad sectors ? ... )

What do you propose as an expert ?

 

Does Labview contain a kind of librairies, or functions, that inform me these details ?

 

Thank you in advance !

 

0 Kudos
Message 1 of 11
(4,023 Views)

Looking into the "flags" you want to read and provide, i have to confess that i doubt for success.

 

Is HDD OK?

This requires running dedicated HDD test tools like HDD Health or Scandisk. So it depends on:

- Can those tools run in parallel to an OS (require reboot for scanning)?

- If yes, does it have an interface you can hook to (DLL)?

- What are performance impacts? Those can easily hog your whole system making your application effectively unusable...

 

Temperatur?
Depending on the system, there might be an API you can use in the LV appication to collect temperature values from e.g. CPU and things like fan speeds. Not sure if every system provides such features...

 

Is RAM OK?

Essentially same answer as HDD flag, but afaik all RAM test tools cannot be executed in parallel to other user software....

 

I suggest you to search the internet for available tools, their API and their constraints. You should focus on performance impacts as well as quality (result accuracy).

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 11
(4,011 Views)

Norbert already gave you some informations. The information you want to read are not a standard supported feature of Windows. As such they are only available on certain systems that support monitor services and APIs to access this information.

 

As far as HD is concerned you want to read SMART information from the HD controller. Windows does not really supply an API to query this information so you need to access the low level device with passthrough mode to access directly the SMART interface on the HD controller. This is fairly cumbersome and also slightly different for each type of HD interface IDE/SCSI/SATA/Firewire/etc. One way to query this information under Windows more generic is by using WMI but it's still not trivial and can fail for many reasons if the HD is not directly connected to the motherboard.

 

PC Temperature is anything but standardized. Each motherboard has it's own temperature sensors or none. Also many board manufacturers do not release any API to access this information. If they do it is always manufacturer specific.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 11
(4,008 Views)

Well Norbert gave you some information. I try to fill in more details but in general you should realize that what you want to do is at best a nightmare to do and at worst impossible.

 

HD information is available through the SMART interface on all modern HD controllers. However there is not really a standard way to access this information. The easiest is by using WMI on Windows to query some of the information. WMI however isn't exactly trivial to use, and rather poorly documented, so it is still a challenge. A lower level approach is by using the pass through capability of the device driver interface to HD devices and query the SMART information directly from the HD controller. This has the advantage that the SMART request and response blocks are well documented, but you access the Windows API on a very low level and tShere are subtle and difficult differences in the exact procedure depending on the communication path that is used (IDE/SCSI/SATA/Firewire/USB/etc) with some of them most likely failing to pass through the direct requests (USB being the most prominent case here).

 

PC information such as temperature and memory health is something else that is not standardized at all. While most boards nowadays use internally several temperature sensors (and CPUs have them too) memory health information is only available on specific high end boards usually used for high performance servers. It also requires specific memory chips with error correction.


All this information is then accessed by the BIOS to generate internal reports but it doesn't automatically mean that there is actually also an API to query this information from your OS. Typically only boards that are meant for industrial automation use do come standard with some driver API at least for Windows to access this information. This driver API is mostly in the form of a DLL, but it can be a challenge to get the documentation for it if you are not a large OEM who orders several x thousend boards in one go.

 

So while it all can be done (SMART by using WMI is probably the most promising approach) it is anything but easy and definitely not a write it once and use it anywhere solution. It requires in the case of board temperature and memory health specific hardware with manufacturer delivererd system drivers that have to be accessed through their DLL interface (which is completely different for every manufacturer). For SMART, while WMI is a promising option, there is also no guarantee that it will work, since the actual physical HD interface may be hidden from your OS by a RAID controller or other secondary interface such as USB, that does not support transparent pass through requests to the physical HD interface.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 11
(4,004 Views)

One important question came to mind:

Are you running PXI?

If so, which chassis and which controller?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 11
(3,995 Views)

@Norbert_B wrote:

One important question came to mind:

Are you running PXI?

If so, which chassis and which controller?

 

Norbert


Interesting question. I would suppose NI has according drivers for their own PXI controllers. 🙂

 

The OP sounded however like he might be using a standard PC here.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 11
(3,988 Views)

Mr Norbert_B, Mr rolfk,
Thank you both for these detailed answers !

 

atfter few reseach that I was doing since my last post, I agree with all what you did said.

 

I will forget about T° measurement, because each manufacturer have his specific way to control the uC temperature.. even, some manufacturer don't install sensors on their motherboards..

 

About the HDD, I'm not using RAID or USB connections, it's a normal SATA II. Any way, I could get these informations in RT :

- Error rate of raw reading

- Displacement error rate

- Temperature in degrees Centigrade

- Hardware ECC repaired

- Number of write error

- Error rate ULTRA DMA CRC

- and other parameters ....

 

How ? Well, I joined the VI ! and in addition to that VI, I had to use a DLL file that I called "HDD.dll" (it's a DLL that I generated with VB after few research on google, i could found something !! ) and "register" it with and application named "DLL_Registration.exe" because Windows didn't wanted to use it directly 😕

 

Now I'm able to read all these data BUT only under XP. I couldn't do the same thing under Win7 because a compatibility problem with the DLL. That's normal, but not funny 😕

 

The RAM test is generally too slow.. and i's not that simple to implement it, if it's possible already 😕

So, i found two VI to control HDD size, RAM size, and my costumer should be happy with that !

 

And to answer your question : I'm using a standard PC ........ I wished running PXI !!

 

Thank you both !!

(sorry if my english sucks, i was thinking frensh and writing english in RT 😄 )

 

 

A. Houssam

LabVIEW/LabWINDOWS CVI Test bench engineering, monitoring and control systems.

Tunisia

 

0 Kudos
Message 7 of 11
(3,985 Views)

Another reason why retrieving SMART information under Windows 7 might fail is that accessing devices directly, which is necessary to read SMART information with passthrough method, requires administrative privileges for the application in question. Not sure if WMI access is hampered in the same way, as WMI might not do the device request passthrough in the application context but instead in a seperate deamon that runs with system privileges.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 11
(3,981 Views)

A seperate deamon that runs with system privileges installed on the costumer PC where he have all his confidential data is not good 😄

 

And yes, SMART informations need passthrough methods to read it, and necessery privileges as you said. I'm running the Application with the option "Run as administrator" so no problem with that.

 

 

0 Kudos
Message 9 of 11
(3,976 Views)

This deamon would be a standard Windows service, of which you have about at least two dozen running even on a minimalistic Windows installation.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 11
(3,972 Views)