Jump to content

FB Protocol config error


Recommended Posts

Hello,

I'm having trouble with reading anything (value) from a weighing indicator connected to a V570 PLC via RS232. The wiring is OK, and I know this from the fact that when i enter serial monitor and go to port 2, I am able to read all the messages (in ASCII) from the weighing indicator (pic number 4). When I try to configurate the protocol in ladder, I keep getting status: 1 (which in manual says Send: General Error Indicates an unknown system error.). I'm not trying (need) to send anything to the weighing indicator. My configuration is as follows.

9600 baud rate, parity: none, 1 stop bit, 8 data bits on both the PLC and the indicator.

Any advice on how to fix the general error is welcome :)

Thanks in advance

4.png

3.png

5.png

6.png

7.png

Link to comment
Share on other sites

  • MVP 2023

Hi Fidko,

I've never worked with a weighing indicator, but looking at this quickly my immediate thoughts are that you have a few things wrong, easily corrected:

1).  You are calling the read every scan, which might be creating a buffer issue.

2).  You don't have a Protocol Send FB.  ie how does the controller know when the unit is sending things etc?

2).  The message layout doesn't match what your screenshot implies.

3).  Why is MI30 showing -1?

So.....your current layout, to me, has distinct errors.  Check out the help file found by (in Visilogic) going to FBs/Protocol/Help at the bottom.   Once the Help file is open, click on "Basic Example" and check it all out, ensuring you have it all as suggested.

Hopefully this will get you going. 

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023

MI 30 is showing "-1" because the incoming stream doesn't match the defined Protocol block message.  You didn't post the details of the definition for variable 2, but it's probably choking on the "+" sign.

I personally don't use the predefined Unitronics protocol variables for the reason that the incoming stream format has to match EXACTLY or the Protocol Scan block will kick it out.  Try adding a second variable that is a Stream variable 20 characters long, and set up an entry on the Memory tab at the bottom of the screen so you can see what's received.  Then you can use the String functions to parse out what you need.

Posting your code would be helpful, too.

Joe T.

 

Link to comment
Share on other sites

Thank you for the advice guys. I was actually able to solve the problem yesterday. I was working under the assumption that the general send error was a mistake in the wiring. The weighing indicator was actually continuously sending streams, so I changed the variable in the scan from decimal ascii to a stream with the exact lenght and it worked like a charm. That means Joe is spot on with the recommendation for reading the incoming streams.

Once again thank you for the help and the fast response. You guys are great.

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...