How do you write serial commands to multiple comm ports, and can i use a variable on the comm port number?

Viewed 35

I am trying to control a few things over serial communication over COMM, but the COMM number may change, and I have a few variables that I'm trying to include. I need to set a set of power supplies to a certain Voltage and current remotely, and I have attached some idea of what I need it to do, but I do not know VBA and wondering if someone could show me the syntax for the following, so I can understand it a bit better.

'set variable cycle=0

'loop while cycle is less cell#B12

''comm(cellE4) (trying to call comm6 but 6 as athe variable if possible)

'send "SYSTem:REMote"

'send "OUTP ON"

'send "VOLT:LEV (cell#c4)"

'send "CURR:LEV (cell#d4)"

''comm(cellE5)"

'send "SYSTem:REMote"

'send "OUTP ON"

'send "VOLT:LEV (cell#c5)"

'send "CURR:LEV (cell#d5)"

''comm(cellE6)"

'send "SYSTem:REMote"

'send "OUTP ON"

'send "VOLT:LEV (cell#c6)"

'send "CURR:LEV (cell#d6)"

''comm(cellE7)

'send "SYSTem:REMote"

'send "OUTP ON"

'send "VOLT:LEV (cell#c7)"

'send "CURR:LEV (cell#d7)"

''comm(cellE8)

'send "SYSTem:REMote"

'send "OUTP ON"

'send "VOLT:LEV (cell#c8)"

'send "CURR:LEV (cell#d8)"

'wait (cell#C12) minutes"

''comm6

'send "OUTP OFF"

''comm7

'send "OUTP OFF"

''comm8

'send "OUTP OFF"

''comm9

'send "OUTP OFF"

'wait (cell#D12) minutes

'cycle variable increase by 1, end of loop

Example of my document

i need to transmit the text and append carriage return and new-line characters

0 Answers
Related