Join us today!

How to Map External...
 
Notifications
Clear all

How to Map External Enumeration from Library to Enumeration with {attribute 'to_string'}

15 Posts
4 Users
10 Reactions
557 Views
Posts: 17
Topic starter
(@romang)
Eminent Member
Joined: 2 years ago

I have an external Library i use for Rfid Reading from Turck.

Now there is an Enumeration in the Library with the Error Codes.

To use this Error Codes in my Hmi, i want to add the Attribute {attribute 'to_string'}, so i get a string, not only a Number.

Is there a faster way then just dumb writing it from the DataSheet :X, like extending or something (obv. that does not work).

Reply
14 Replies
2 Replies
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@romang 

Hello,

I also have a RFID Turck...

I'm interested if it's possible that you can share the library...

Thanks a lot 🤩 

Reply
benhar-dev
(@benhar-dev)
Joined: 2 years ago

Eminent Member
Posts: 17
Posts: 17
Topic starter
(@romang)
Eminent Member
Joined: 2 years ago

I can later on, still on the first steps.

I use the TcOpen Framework and try to integrate Unit Tests for the first time in real :X

Looking forward to feedback.

How to best share it? Could upload it to GitHub probably

Reply
4 Replies
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@romang ,

It's great that you use Tcopen and Unit test to develop 2 good frameworks... 

on GitHub it would be great so I can help with something... 😉 

Reply
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@romang

Have you dared to create the repository on GitHub? 🤗 🤩 

Reply
(@romang)
Joined: 2 years ago

Eminent Member
Posts: 17

@runtimevictor Haha

even less now,

after seeing what @rruiter posted.

 

I will post it later today, but keep in mind,

it is not close to finish, and its tailored to my needs atm.

Reply
rruiter
(@rruiter)
Joined: 2 years ago

Estimable Member
Posts: 63

@romang don't feel intimidated. Its always good to share.

Reply
Posts: 17
Topic starter
(@romang)
Eminent Member
Joined: 2 years ago

https://github.com/RGrabichler/TurckRfidReaderLib/blob/main/README.md

here is the github. 
Under develepment atm 😀 and alot of open questions.

Feel free to try and give feedback or critcize

Reply
1 Reply
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@romang ,

If you want to add more functionality, with variant manager you can combine the simulation with the real hardware,

but this functionality with variant manager I think would be in another project where there is only the RFID library combining the real hardware or the simulation if you don't have the hardware...

if you don't know how to do it I can send you a simple project where you can see it...

There is a folder called PLCConnector, I don't know what type of project it is? so that it can be opened...

Reply
Posts: 17
Topic starter
(@romang)
Eminent Member
Joined: 2 years ago

i am aware, but never used, the variant manager.

Not sure, if or how this helps me here, because for the unit tests, i have to have a "simulation" with the mock objects in the library. Or is there any other and better way? Because i really have a hard time, modeling the Outputs of the Turck Library 😀 and connecting in properly. (This Post from Sagatwoski https://alltwincat.com/2018/05/23/mocking-objects-in-twincat/ was my initial idea with the Mock Object);

Send me the project please, i will look at it.

The PlcConnector is a leftover in C#, necessary if using the Blazor App to connect to the Plc (TcOpen Framework)

 

Reply
2 Replies
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@romang,

 

are you using blazor for display?

 

Reply
(@romang)
Joined: 2 years ago

Eminent Member
Posts: 17

@runtimevictor yes i do,

the advantages of programming alone 😀

Reply
runtimevictor
Posts: 156
(@runtimevictor)
Estimable Member
Joined: 2 years ago

@romang ,

Has it given you any ideas or has what I sent been of any use to you?....

Reply
1 Reply
(@romang)
Joined: 2 years ago

Eminent Member
Posts: 17

@runtimevictor i looked at it, and came up with a solution which works for me.

In the last few days, i continued my work with the Turck Rfid Reader Lib.

I implemented the parts, which i use atm.

But i think its obvious, how to extend it to any function provided by turck.

Reply
Share: