Lurch68b

Can I read back a value from an external program?

3 posts in this topic

#1 ·  Posted (edited)

Hi all, This is something I was messing with a while back and I have searched for the answer but couldn't find anything that seemed to apply to what I am trying to do. 

Basically I have an in house program that can read and allow control of functions on a motherboard, fans and sensors. I can control the fans without issue, that was the easy part. Now I am trying to read back values like PWM, Temperature, ect. This is an example from the readme file. I tried to read the info from a DOS window but autoit doesn't see anything but the basic windows info.

So the line as it looks now is this ShellExecute ("wcmdtool.exe" , "20 c0 14 0d 00" & $SEC00) What I am hoping with this line is that when I set the fan speed that I can read back from the register to validate that it was set to the right thing. 

To read the PWM output of a fan zone:
wcmdtool 20 c0 14 0d #1 00
where #1 is the fan zone
the fifth column of the output is the fan PWM in HEX

This is probably not going to work the way I want it to work but there it is.

 

Fan_Speed_Test2.au3

Edited by Lurch68b

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thank you John, I probably should have also included the output of that command as well. I only need the last value 20 c0 14 0d 01 00 20 C4 14 00 (17) So if I set 41 or 17 or 1A that is what I should be able to read back from the controller. I guess I would need to parse it or some such thing? 

 

So this is what I tried 

#include <constants.au3>

Local $foo = Run(@ComSpec & "wcmdtool.exe" ,"20 c0 14 0d 00", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $Line
While 1
    $Line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT Read;)", $Line)
WEnd

While 1
    $Line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT Read;)", $Line)
WEnd

 

I will go out and dig around for examples for StdoutRead now. :)

wcmdtool_Read_PWM.png

Edited by Lurch68b

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now