Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Your Modbus register maybe over riding the tag value. Try the attached project, which does not use Modbus registers and see if it works.
You should be able to read out what is in tag arr_EventRegisterGroup_0[0] by doing something like this after you add AnalogNumeric1 control to your screen:
I may be misunderstanding, but let me throw this out there:
I WANT modbus to override the tag arrays. I have another device out on ethernet, and it is supposed to fill these tag arrays. Then, in code, I have to do some parsing.
Also, a non array tag displays 40400 correctly, but I cannot grab the value of the first entry in an array tag that starts at 40400.
Is trying a non modbus project as you provided still valuable? I will still do it, but I have to upgrade my ixDeveloper to do that.
The problem is that I do not have a modbus system here to play with. I am not sure if the issue is with your program, your modbus system, or something else entirely.
If you can manual pull a single value out of the array attached to a modbus register and display it in an Analog Numeric box, then we know it is the code and not something else.
Hence if the below code works, then something is wrong with your code.
AnalogNumeric1.Value = Globals.Tags.arr_EventRegisterGroup_0[0].Value;
The example project I sent you is simply in case there is something wrong with your code. It might help you to see an example that works.
Thank you for the example project. Here is what I found:
The project as-is works fine (I changed only the target display).
The project with a modbus controller and addresses does not work. All I changed was 1. changed the controller from DEMO to a modbus master (tcp/ip) that points to my 3rd party device, and 2. added modbus addresses to Tag1 and Tag3. (see attached pic). I DID NOT MODIFY THE CODE in any way.
Tag Addresses
TagAddresses.png (7.35 KiB) Viewed 46155 times
The result is that the left AnalogNumeric shows the value -24541 (Tag3). The right AnalogNumeric shows 0, even after touching the "Second: Copy Value" button (which should have brought -24541 from Tag1[0] into Tag2 to show on the right AnalogNumeric).
So I ran your code and connected it to a modbus simulator program. Ushort stands for unsigned 16-bit integer, that means you can not use negative values with it. Use my modified program and do that same thing but use a non-negative value, like 52. It should work.
Your C# code is "ushort[] arrEvent=new ushort[14];" can not be used with signed integers otherwise it will destroy the sign on the number. Change that to int if you want to use signed numbers.
int[] arrEvent=new int[14];
If it still doesn't work for you, PM me with your version of iX Developer. I am using 2.0.463 and it works fine. I can send you the new version for you to try.
OK. Matching the datatype in the code to the tag datatype helps. The root of the problem here is that the tag array was only used in the script, and the "Always Active" box was not checked, so that Tag1 was never getting updated. Hence, it was always zero.
I suspect that my original project has the same issue.