Sign in to follow this  
Followers 0
frank.raymond

ETN Function Blocks

11 posts in this topic

In regards to the file Modbus_TCP_FB.cxp in the download section, Does the ETN module need to be configured in the IO section? Where can I find more info on the FB's for opening, sending, receiving, closing? I downloaded a manual from the Omron website that has the same info as reference library. As an example I am struggling with the DestIPAddress1, address2, etc. When looking at the internal elements I see the initial values set at 0 and in the ladder that makes the FB I see DestIPAddress in a compare block (>254) and then in a MOVD block as the source word. However in the ladder logic I see the values at 192.168.1.100 (outside the FB). Where did this come from??? Mr Nibroc, can you lend to this please?

Share this post


Link to post
Share on other sites
Do not bother about understanding the workings inside the FB if you do not understand its function. The 192.168.1.100 would of come from the person that configured the code.

Share this post


Link to post
Share on other sites
Thanks for the response. I reckon I didn't make myself clear.... "When looking at the internal elements I see the initial values set at 0 and in the ladder that makes the FB I see DestIPAddress in a compare block (>254) and then in a MOVD block as the source word. However in the ladder logic I see the values at 192.168.1.100 (outside the FB). Where did this come from???" I believe these values are set internally to the FB however when I look at the internal logic I see that they are set to zero for the DestIPAddresses. What I am trying to understand is how the ladder reflects an IP of 192.168.1.100 when the internal logic of the FB is set to zero. If I understand these small insignificant pieces of obscure data than I will understand the FB.

Share this post


Link to post
Share on other sites
I will try to help with the explaination. If I misunderstand your questions, and I am stating the obvious, I appoligize. The values of the octets of the IP address are passed in as Inputs to the FB. When you look at the inside of the FB, there are 5 types of variables: Internals, Inputs, Outputs, In Out, and Externals. These types have different ways of interacting with the code outside the FB. The DestIPAddress1, DestIPAddress2, etc are Inputs. The fact that they are inputs indicates that they are passed into the FB as Parameters, so they do not take their value from the initial value setting in the FB. See the attached image. Internals will use their initial value until the ladder code changes them. In reality, the Initial Value is very seldom used in Function Blocks.

Share this post


Link to post
Share on other sites
I see the errors of my way. Like you and LostControl said, ignore the internal logic of the FB. All I had to do was click of the value outside the FB to edit. I am now opening the FB however I am getting a Busy & NG. I can see the SD & RD lights flashing about every 3 seconds which is per the 'error' timer (recalling from memory). I will figure this out. Thanks to all for the patience...

Share this post


Link to post
Share on other sites
Frank For your generic Socket Service app, the Modbus TCP is a little too specific. Attached is a more appropriate example (created from the Modbus one). Note: The addressing that I am using is for an ETN21 configured as Unit 1 (on the single digit rotary switch on the module). This sets 2 of the addresses, and 1 parameter input to each FB. The 2 addresses are 1534.13 (Unit 1 Socket 1 message received) and D30101 (Unit 1 Socket 1 Number of Bytes Received). Generic_TCP_Application.cxp Also attached is a TCP app that I did several years ago for a customer (no function blocks) to communicate with 3 Microscan QX-830 bar code readers. Microscan_Bar_Code_Reader_via_TCP_MS_QX830.cxp

Share this post


Link to post
Share on other sites
Thank you Jay. After a bit of polishing from my side, the plc and vb app are communicating. The VB app is an excellent tool. There are not enough emoticons that can convey my appreciation but here goes, to the 'da man... frank

Share this post


Link to post
Share on other sites
Frank Glad to help. Hopefully those examples will also help others. Good luck on your project. PMCR

Share this post


Link to post
Share on other sites
In regards to Generic TCP Client and Server in VB6 download in utilities, how does Winsock1_DataArrival Handle Null Characters? The reason I ask is the first sent word from the PLC is h0002. I was hoping to use move predefined words into the registers before and after the variable words which would mean a possibility of null characters being sprinkled here and there. It appears I'll have to massauge the data to remove the null caharcter(s). Am I on the right track? Edited by papa francisco

Share this post


Link to post
Share on other sites
Frank The NULL characters will be received by the PLC, and stored in the PLC as character 00. In the world of PLCs, these are just as valid as any other character. If you received NULL characters, you may need to remove them. Obviously, this depends on your protocol and application. The PLC does not handle NULL any differently if you are using a serial port or a TCP socket, if this helps.

Share this post


Link to post
Share on other sites
But how does VB6 handle a null character. As an example I sent, from the PLC a value of 0002. I was expecting a vertical line (nonprintable character) for the STX however the code appeared to have stopped. When I sent 0231 I saw the vertical line and a 1. This leads me to think the VB app did not like seeing a null as a sent character. I also sent the following 3132 3334 3500 3637 expecting to see 12345|67 however I saw 12345 only. Maybe it's me... Yeah, It's me. There is no problem only PHS (programmer head space). At this time, this link is resolved. Thanks PMCR for your patience and the downloads. Edited by papa francisco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0