0
Fertiggestellt

reading from plc not possible

Willem Van Der Gaag vor 4 Jahren in realvirtual.io Starter and Professional aktualisiert von Support vor 4 Jahren 7

I have added the a sensor from my PLC but as soon as i start running my program it writes a value. I would like to read the current value and not write anything. This is what my sensor looks like when it is added: Many thanks!

Image 227

Antwort

+1
Antwort

OK but usually PLC Inputs should only be written by Unity and not read.

You could manually create your table using excel (in the form TIA Portal is creating the tables) or you could manually create the IOs in Unity. Please delete the spaces in the names so it should for example be "I5.0" and not "I    5.0"). Maybe this is also an issue.

Wird überprüft

You need to define it as PLCOutput not as an Input.

It is possible to read an output with address Q 5.0, but is is necessary for me to use I 5.0

Q... are PLCOutputs (which only can be read) and I.... are PLCInputs (which you can only write).

Usually during signal table import G4A should automatically create the type needed (PLCOutput.. or PLCInput...).

What I am wondering about are the spaces in the names / addresses. And your signal table looked different from the usual tia portal export. What kind of programming system are you using. Is it the old Step7? 

Yes I'm using the old step7 so i will probably make a script to export the right type of table. I made it possible to use the inputs as outputs by changing the INPUT to OUTPUT  for case 'I" in S7Interface (line 143)

+1
Antwort

OK but usually PLC Inputs should only be written by Unity and not read.

You could manually create your table using excel (in the form TIA Portal is creating the tables) or you could manually create the IOs in Unity. Please delete the spaces in the names so it should for example be "I5.0" and not "I    5.0"). Maybe this is also an issue.

I. have configured it as output now but it still wont read...