Search found 137 matches

by AMitchneck
Wed Jun 12, 2019 1:55 pm
Forum: Scripting
Topic: I can,t use Library Expressions like Bitoperators
Replies: 2
Views: 3550

Re: I can,t use Library Expressions like Bitoperators

"(value & 0x1) == 0x1" returns a Boolean value of true or false. My guess is iX is not able to properly convert this back to an integer value and thus returns 0, hence why this value is always blue. Try removing the == 0x1 portion so the bit0IsSet has the formula "value & 0x1". This will result in a...
by AMitchneck
Tue Jun 04, 2019 7:32 am
Forum: Application Development
Topic: FTP Server issue
Replies: 3
Views: 5957

Re: FTP Server issue

s1fis, Using ftp in active or passive mode is determined by the client not the server. The client opens a control connection via port 21. As part of the initial handshake, the client requests active or passive mode. In active mode, the ftp server opens the data transfer port as specified by the clie...
by AMitchneck
Wed May 29, 2019 6:46 am
Forum: Scripting
Topic: Login User with only password
Replies: 7
Views: 11244

Re: Login User with only password

You can keep the login screen from showing "user ... has logged in" by calling the login function passing it false. The following shows the full login screen (user + password requested), but does not show the user has logged in: Globals.Security.Login(false); The corresponding logout: Globals.Securi...
by AMitchneck
Fri May 17, 2019 7:11 am
Forum: Scripting
Topic: Converting ASCII String to Bytes
Replies: 5
Views: 6250

Re: Converting ASCII String to Bytes

It seems the tag type does not directly support byte values so it's trying to type cast it. The error indicates C# can't implicitly determine which type to cast it to. Try the following. This explicitly type casts the byte values to ushort. public partial class Home { void Button_Click(System.Object...
by AMitchneck
Tue Apr 16, 2019 7:39 am
Forum: Scripting
Topic: Converting ASCII String to Bytes
Replies: 5
Views: 6250

Re: Converting ASCII String to Bytes

Assuming the string always has 10 characters you could use the following public partial class Home { void Button_Click(System.Object sender, System.EventArgs e) { string input = Globals.Tags.String_ROC.Value; byte[] array = Encoding.ASCII.GetBytes(input); Globals.Tags.Byte0.Value = array[0]; Globals...
by AMitchneck
Tue Apr 09, 2019 6:32 am
Forum: Application Development
Topic: Script - InstanceName
Replies: 1
Views: 3044

Re: Script - InstanceName

Question: When does 'InstanceName' not exist? During compile or runtime (when you hit build or when you run your project)? If it's the later, are you getting an object null exception? My guess in this case is the window is being shown without being given a value for the alias (i.e. screen is just be...
by AMitchneck
Mon Apr 08, 2019 8:28 am
Forum: Application Development
Topic: Momentary Buttons on X2Pro
Replies: 3
Views: 4310

Re: Momentary Buttons on X2Pro

I don't know how easy this would be for you, but my solution was to place a transparent button over a multipicture. I then made a separate picture for every button state (pressed, not pressed, enabled, disabled, etc. - simplest method is to get these from the compiled output of your current button i...
by AMitchneck
Thu Sep 20, 2018 6:40 am
Forum: Dynamics
Topic: Reconnecting a TCPclient on a X2 Pro
Replies: 3
Views: 7436

Re: Reconnecting a TCPclient on a X2 Pro

I haven't used a TCP client before, but for sockets before you call the close function it is recommended to call the socket.Shutdown(SocketShutdown.Both); method to handshake the closing of the socket. Maybe TCP client has something similar. I will note that sockets work differently on the compact f...
by AMitchneck
Mon Jun 25, 2018 6:44 am
Forum: Scripting
Topic: Create Dynamic Instances of Objects
Replies: 2
Views: 4632

Re: Create Dynamic Instances of Objects

d_reibelt, Technically, this can be done, but I've never tried it before in iX. In C#, to add a control to the screen you would create the object, add it to the form's Controls list, then refresh the form. To remove it, you would remove the object from the controls list, etc. Doing some digging, it ...
by AMitchneck
Thu Jun 14, 2018 8:23 am
Forum: Scripting
Topic: SOS, X2pro7 restart again and again
Replies: 2
Views: 4761

Re: SOS, X2pro7 restart again and again

Rebooting usually means the program is crashing. In this case, what I usually do is place a try {} catch {} around the code and spit the exception to a message box. That way you can get some indication as to what is causing the crash. As the issue gets more complex, I might use multiple catches with...