You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old November 19th, 2020, 08:59 PM   #61
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,655
Quote:
Originally Posted by AlfredoQuintero View Post
... which would require an eternal device ...

Wow, I want one of those, but if it R-A makes then no one could afford it.



  Reply With Quote
Old November 19th, 2020, 09:04 PM   #62
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
Quote:
Originally Posted by drbitboy View Post
Wow, I want one of those, but if it R-A makes then no one could afford it.

You got me there!!! Of course I meant "external...". Before posting I checked the post and let that one go. Thanks for noticing.
  Reply With Quote
Old November 19th, 2020, 11:42 PM   #63
theColonel26
Lifetime Supporting Member
United States

theColonel26 is offline
 
theColonel26's Avatar
 
Join Date: Feb 2014
Location: West Michigan
Posts: 501
For the record I am still here. I just haven't gotten back to working on this project. Also the whole point of this thread was doing it directly. I guess I wasn't completely clear on that in my original post.


I have other project chaos to wrangle.

OT: Who the hell would ever want to be a project manager it stuck. I have to wear many hats, project manager is not one I enjoy.
__________________
SkyCad is by far the Best ECAD Schematic Software I have used.


Fact my "Fun Facts" are never fun
  Reply With Quote
Old November 20th, 2020, 12:44 AM   #64
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
theColonel26, good you are sticking around because I have good news. I was about to roll-up my sleeves and try PCCC mapped tags, but after dusting-off the PCCC spec I realized it would be more difficult than I thought. So I setup one particular third-party (non-Rockwell) Windows application that can read Logix tags and did a bit of Wirehsark analysis. Then I realized that if one is able to find out the instance of the symbol class (class ID 0x6b) for the particular tag within the Logix processor, then you can access the data with a non-documented (or maybe it is documented but I need to study further) service 0x52. Have a look at the screenshot below. It is really cool. I need to find out how to write data to a particular tag, then I will write the Codesys program, for which I should be able to use the 3S libraries.
Attached Images
File Type: png 20201120_LogixCodesys1.png (171.2 KB, 72 views)

Last edited by AlfredoQuintero; November 20th, 2020 at 12:50 AM. Reason: Minor typo
  Reply With Quote
Old November 20th, 2020, 01:55 AM   #65
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
And this is how to send data to a Logix tag. In this case the tag FromCodesys_20words was assigned instance 11 by the Logix application. The service for writing data to a tag is 0x53. I think 0xC4 is the datatype DWORD in CIP spec (...yes it is, just checked the spec.) and 0x14 is the 20 words that are being sent to this tag.
Attached Images
File Type: jpg 20201120_LogixCodesys2.jpg (304.6 KB, 61 views)
  Reply With Quote
Old November 20th, 2020, 02:18 AM   #66
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,184
Alfredo, your suggestion to find the instance number, is exactly steps 1 through 5 of this document.
Quote:
Originally Posted by AustralIan View Post
I think you would need to implement chapter 2 of 1756-pm020 .
An alternative is this code here, which can read any tag in a single message.
http://www.plctalk.net/qanda/showpos...3&postcount=10

Last edited by AustralIan; November 20th, 2020 at 02:21 AM.
  Reply With Quote
Old November 20th, 2020, 04:14 AM   #67
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
AustralIan, thank you very much. Now that I have done all I did I can more or less understand this code. For a practical application in Codesys though, do you think it is necessary to automate the process to find out the instance. I would do this part manually because the instance of the tag should not change once the Logix program is ready.
  Reply With Quote
Old November 21st, 2020, 03:23 AM   #68
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
I was able to write a program which can read data from Logix tags into Codesys variables using ENIP.Generic_Service. However now I realize this service cannot be used to send data from Codesys variables into Logix tags, because this ENIP.Generic_Service is not generic enough, as it only supports logical segments with Class, Instance and Attribute or Class and Instance elements in the CIP path. For the service 0x53 it is necessary the support for Member in the CIP logical path. Let's hope 3S adds in the future a variant of this ENIP.Generic_Service function with a more flexible CIP path structure. Hope this is helpful.
Attached Images
File Type: jpg 20201121_LogixDataIntoCodesys.jpg (141.9 KB, 52 views)
  Reply With Quote
Old November 21st, 2020, 02:39 PM   #69
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,184
Hi Alfredo, Colonel.
Can you check out my READ_TAG / WRITE_TAG FB's?
It needs that dummy DINT[2] in the CLX to establish a connection.

So far I think it will only work with non-structured, non-array datatypes. And only controller scope tags.
Let me know if you need arrays, structs, or DINT.Bit and I will see what I can do adding these on.
Attached Images
File Type: png READ_WRITE.png (69.3 KB, 7 views)
Attached Files
File Type: zip CLX.zip (319.4 KB, 3 views)
  Reply With Quote
Old November 22nd, 2020, 04:00 AM   #70
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
Quote:
Originally Posted by AustralIan View Post
Hi Alfredo, Colonel.
Can you check out my READ_TAG / WRITE_TAG FB's?
It needs that dummy DINT[2] in the CLX to establish a connection.

So far I think it will only work with non-structured, non-array datatypes. And only controller scope tags.
Let me know if you need arrays, structs, or DINT.Bit and I will see what I can do adding these on.
Hello AustralIan: Thanks very much for your program. I have been studying it for hours and amongst other things it was useful to disabuse me of my delusion that I had in-depth understanding of CIP protocol. By studying your code I realize I am just scratching the surface. Thanks for taking the time; I think this program is brilliant and I am learning a lot thanks to it.

I have tried to make it work. So far I have only tested the reading of Logix tags. I can only get the first DWORD of the tag. I will modify the program to be able to pass the number of elements to read or write. I had an issue with the write function which crashed the PLC application There may be some pointer issue there. I intend to post the program when I get it working.

By the way how do you attach screenshot files with only a link to them? I always get the screenshot below the text.
Attached Images
File Type: png 20201122_01.png (180.3 KB, 36 views)
  Reply With Quote
Old November 22nd, 2020, 06:49 AM   #71
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,655
Quote:
Originally Posted by AlfredoQuintero View Post
By the way how do you attach screenshot files with only a link to them? I always get the screenshot below the text.

Based on observations:


When there is only one image attachment in the pos, the forum software shows the image to the image at the end (unless it was inserted earlier). If there is more than one attachment, then the forum software displays links to all attachmnets, including any images, at the end.
  Reply With Quote
Old November 22nd, 2020, 07:44 AM   #72
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
Quote:
Originally Posted by drbitboy View Post
Based on observations:
When there is only one image attachment in the pos, the forum software shows the image to the image at the end (unless it was inserted earlier). If there is more than one attachment, then the forum software displays links to all attachmnets, including any images, at the end.

Thanks.
  Reply With Quote
Old November 22nd, 2020, 05:10 PM   #73
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,184
Hi Alfredo, Thanks for debugging it and adding some features .
I could not find a cause of PLC crash in the WRITE_TAG()... but there was an error. Line 122 of WRITE_TAG should read:

Code:
IF Response[4] = 16#CD AND Response[5] = 0 AND Response[6] = 0 AND Response[7] = 0 THEN
  Reply With Quote
Old November 23rd, 2020, 02:46 AM   #74
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 373
Hello AustralIan and theColonel26:
I have added more features to AustralIan's program.
Now you can pass the pointer of global variables in the Codesys PLC application to the read and write functions for Logix so you can get the process data neatly separated from the protocol overhead.
I have not tested with data types other than DWORD, so for different data types there may be some issues that would need to be tweaked.
I hope this is helpful.
Attached Files
File Type: zip 20201123_LogixCodesys.zip (2.02 MB, 1 views)
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Cheap PLC that can read Data from its SD card or USB Flash Drive? theColonel26 LIVE PLC Questions And Answers 10 May 25th, 2019 11:38 AM
FactoryTalk 8.0: how to display choosen tag value from PLC Suseh LIVE PLC Questions And Answers 4 June 18th, 2015 02:59 PM
Any idea how to access the Omron simulator? strantor LIVE PLC Questions And Answers 9 March 13th, 2015 07:01 PM
RSLogix 5000 Multiple Aliases to Same Tag davidc100 LIVE PLC Questions And Answers 10 May 27th, 2014 09:04 PM
Read and write data from pc to plc via rs232 cable MANISH VORA LIVE PLC Questions And Answers 4 August 23rd, 2011 02:47 PM


All times are GMT -5. The time now is 02:19 PM.


.