Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

incremental values sending

Status
Not open for further replies.

ericinthelab

Technical User
Sep 16, 2010
2
US
Hello, I have just been tasked with writing a script that transmit two separate commands. The first command calls up a specific location then the second edits the value. The fist command will need to be run several times a with an incrementally increasing value. For example transmit "00ba^M", then the next line I would edit some of the values displayed(same command ran here every time). I will need to then run the transmit command again with the 00ba value up by a certain amount. Is there a way to accomplish this ? The value would be in hex if that helps.
 
Are the incrementing values always going to be the same range? How many values are in the range? You could read those values from a text file if they are changing, or hardcode them in the transmit statements if there are just a few of them.

 
Thanks Knob for responding! Several hundred hex addresses that increment by 4 bits each time from the proceeding value. It's more of a time saver for me otherwise I get to count in hex by multiples of four all day long.
 
OK, give this a try then. This script shows how to step from 1024 to 2048 (decimal), convert to hex, and transmit those values plus a carriage return.

proc main
integer iNum
string sOutput

for iNum = 1024 upto 2048 by 4
strfmt sOutput "%X^M" iNum
transmit sOutput
endfor
endproc

If necessary, you can add some additional static text to the strfmt command in case the remote system needs a particular format.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top