Page 1 of 1

Simulator mode detection using scripting

Posted: Wed Mar 13, 2019 6:09 am
by pepijn_h
Hi all,

I was wondering if there is a way in iX developer to determine if the project is in the simulator mode.
Use case: Automatically change the com port number to another defined COM port if the simulator is launched. The com port numbers differ between PC and Beijer terminal.

P.S. I currently use a define to select the simulator mode but that is still a manual process to change between simulator and real terminal.

Cheers and thanks in advance,

Pepijn Hogervorst

Re: Simulator mode detection using scripting

Posted: Wed Mar 27, 2019 8:33 am
by kim
Hi

Below a code I am using successfully (X2 Pro terminal, not PC)

Code: Select all

	if(System.Environment.OSVersion.Platform == PlatformID.WinCE)
				sXmlFiles = @"\Hard Disk\Parameters\";		
			else
				sXmlFiles = @"C:\Parameters\";

Re: Simulator mode detection using scripting

Posted: Tue Apr 02, 2019 3:13 am
by pepijn_h
Thanks that is exactly what I need!