So I am trying to have a serial command sent whenever a machine is booted. I figured powershell would be a good way to do this (which it may or may not be.)
The device I am sending the command to needs to receive "~0000 1" followed by a line break.
this is what I have so far:
$port= new-Object System.IO.Ports.SerialPort COM10,9600,None,8,one
However the message isn't making it accros.
I have treid changing things to:
$port.WriteLine("~0000 1 'r")
$port.WriteLine("~0000 1 'n")
incase the issue was the CR/LN not being sent at the end of the line, but none are working. so first question:
Do I have the right usage for the <CR> command?
Could the problem be the "~" should this be sent using some funny command like [char]126 ??
Is there anything else obvious going on here that I am getting wrong?
Is there a better way to do this, (batch file maybe?)