Am adding GPIB support for some devices that right now only have com port support foreseen in the device files.
My question:
For devices where the device file permits multiple port types, (com and GPIB for example), is there any way to detect which port type the user has configured?
In my case, the device does not support some commands (SYS:LOC and SYST:REM in my case, HP663xB) when on GPIB, but does support them in RS232.
I cannot interrogate the device to see what port it uses, as that command does not exist.
So unless I remove the offending commands from the device file, thereby potentially breaking things for existing users, GPIB users will be stuck with loads of errors on the device.
Both options are not ideal. It would be best if I could detect the device config and adapt the commands to it.
Something like:
#port comfixedbaud GPIB
.....
if (port=="comfixedbaud")
#initCmd *RST;SYST:REM
else
#initCmd *RST
endif
Is something like this possible?