VDT2 - portname as string
joce
Hello! I'd like to open and manage VDT2 connections with the portname set as a string. This is apparently only working for COM1 to COM4 where no single quotes are required. Is this intended or am I missing something?
As a workaround, I could simply "execute str" all VDT2 operations, but I want to run some of the code in threadsafe functions which don't yet support "execute". Any help is appreciated!
function id_device()
// results in error message: "Expected the name of an installed port (such as Printer, Modem, COM1, COM2)"
string portname = "'COM10'"
VDT2/P=portname abort,baud=115200,Databits=8,parity=0,Stopbits=1
// works fine
VDT2/P='COM10' abort,baud=115200,Databits=8,parity=0,Stopbits=1
end
// results in error message: "Expected the name of an installed port (such as Printer, Modem, COM1, COM2)"
string portname = "'COM10'"
VDT2/P=portname abort,baud=115200,Databits=8,parity=0,Stopbits=1
// works fine
VDT2/P='COM10' abort,baud=115200,Databits=8,parity=0,Stopbits=1
end
you can use
VDT2/P=$portname
May 28, 2024 at 01:48 am - Permalink
In reply to you can use VDT2/P=… by tony
Great, thanks a lot! I tried $ but didn't remove the single quotes...
May 28, 2024 at 03:29 am - Permalink