Mitsubishi GX Works3/FactoryIO & C# Connection

diamonddog

Member
Join Date
Mar 2023
Location
Berlin
Posts
1
Hello,

As a newbie to PLCs, I have two issues.

1) I connected Mitsubishi GX Works3 and Factory IO on a project I am working on. But when I do a read/write operation on GX Works3 variables using MX OPC Configurator over C#, I immediately get a "Connection number acquisition error" error. For this reason, my variable updates via MX OPC are not reflected in Factory IO and I cannot use the simulation properly.

2) I'm making updates on MX OPC Configurator Tags using C#, but how can I send string type data using C#?

for example;
plc.SetDevice(string, int) // string field is for tag name, int field is for value

plc.SetDevice(string, short) // string field is for tag name, int field is for value

With the above two methods, int and short data can be sent, but I couldn't see a method offered by MX Component to send string type data

Is there anyone who has knowledge on PLCs that can help me in this regard?🤞🏻
Thanks in advance.
 
Not used MX component for many years, Mitsi PLC's do not really handle strings over coms directly, a String is just a bunch of D words i.e. a D word would contain the ascii value of say "AB" (If I remember rightly it is reversed).
So perhaps you would need to send them as a number of words not as a string
I found this not really looked at it but may give you some ideas.

https://www.youtube.com/watch?v=_5vSMpVfJ-I
 
MX Component is official Library.

You must use MX Component Version 4 or later.
This support GX Works 3.

But earlier version not support it.

If you use GX Simulator2 , and you can choise a lot of informal library.

Example, "simple gx"

This DLL has simple function.


Donwload here
https://ftp.vector.co.jp/75/96/2271/SimpleGX.zip

This DLL written in C++(Call Windows API) and VB.NET.


VB.NET Code

Dim ins As New GXSim
ins.CPU = enumCPU._Non

Dim rtn As ReturnUS = ins.ReadDeviceBlock2("D0", 10)
MsgBox(ins.UShortDis(rtn.dat, "/"))
Dim dat(960) As UShort : For i = 0 To 959 : dat(i) = i + 1 : Next
ins.WriteDeviceBlock2("D0", 960, dat)


C# Code

GXSim ins = new GXSim();
ins.CPU =(int)enumCPU._Non;

ReturnUS rtn = ins.ReadDeviceBlock2("D0",10);
MessageBox.Show(ins.UShortDis(rtn.dat,"/"));

ushort[] dat = new ushort[960];
ushort i;
for (i = 0; i < 959; i++) { dat =(ushort)(i+1) ; }

ins.WriteDeviceBlock2("D0",960,dat);

////////////////////////////



"enumCPU" means postfix in PLCtype.

example,

Q00CPU - enumCPU._Non
q26udvcpu - enumCPU.UDV
 
Last edited:

Similar Topics

I'm absolutely stuck at this point with the recipe portion of my program. I used the default example they had on their website to create the...
Replies
0
Views
1,767
Hi Guys, Who amongst us has worked on Mitsubishi FX5U with Analog extension modules and GX Works3? Please, I will need your support here...
Replies
0
Views
910
Hi Friends, Please, who can tell me the Function Block used for scaling 4-20mA to say 0-200PSI in Mitsubishi GX Works3?
Replies
6
Views
7,319
Hello! If someone can help me with the following problem. I can't change the phone number. Do I really need the interface (AL-232CAB - Programming...
Replies
0
Views
45
how to communicate FactoryTalk Optix and Mitsubishi Q Series. I want to know the details of that
Replies
0
Views
41
Back
Top Bottom