SMARTUPS rs232
paradigmpaul
Posts: 24
I am trying to build a module to monitor/control a APC SmartUPS SC420 from an NI2000 rs232. Anybody been down this road yet?
Document Reference:
http://sibbald.com/apcupsd/3.8manual/upsbible.html
for example the string it says to send is "^N" or several different commands prefixed with ^
from hyperterminal the caret is not accepted, response=NA, however <ctrl>N ellicits the desired response
WHat would i use as an escape character so the the string "^N" is sent or do i have to send it as HEX, all the other commands are ASCII
also this is my first attempt at intelligent RS232 communication(query/response vs blindly sending strings)
what is the best way to parse the response? anyone have code snippets?
Thanks In advance
Paul
Document Reference:
http://sibbald.com/apcupsd/3.8manual/upsbible.html
for example the string it says to send is "^N" or several different commands prefixed with ^
from hyperterminal the caret is not accepted, response=NA, however <ctrl>N ellicits the desired response
WHat would i use as an escape character so the the string "^N" is sent or do i have to send it as HEX, all the other commands are ASCII
also this is my first attempt at intelligent RS232 communication(query/response vs blindly sending strings)
what is the best way to parse the response? anyone have code snippets?
Thanks In advance
Paul
0
Comments
I don?t think ^N is meant to be sent as a 2 character string. I think it?s looking for SO (shift out) which is $0E in the ASCII chart. ^A = $01 and ^Z = $1A So?.
SEND_STRING dvUPS, ?$0E? should turn the UPS on.
HTH
Code for parse of the response:
Joe & Yuriy
Thanks for the input, I worked out part of it own my own, but i will try your suggestions and let you know how it works out..
Cheers,
Paul
About codes such as "^N" it is possible to look here:
http://en.wikipedia.org/wiki/ASCII
Ok after alot of investigation, I have come up with this
I know it is not extremely elegant code but it is functional..
on low power it shuts down the Max and SoftSwitches the SmartUPS off untill the battery charges to 90%.(UPS return threshold set by 'e')
Anybody has comments suggestions i would be happy to hear them.
Cheers,
Paul