gftbak

use PMCR or RXDU function in scheduled interrupt

5 posts in this topic

Hi, I'm having following problem. I have several plc's that has to read serial data on an scu 21 card. (cj2m cpu14 and cj2h cpu64) Those plc are running a cycle time around 20ms. The data on the scu-card-port is coming continuously. With a pmcr or rxdu function running once every 20ms i'm losing data. When I reduce program load as a test and run cylce time's about 1 ms, the problem is solved. of course I need to run the full program and read all the serial data. I've tried using PMCR or RXDU in a sheduled interrupt (1ms). It seems that PMCR and RXDU are not working in a sheduled interrupt. (they run once on the first execution) I there a solution? kind regards

Share this post


Link to post
Share on other sites
I use this and have been using it for years without any issues. http://forums.mrplc.com/index.php?app=downloads&showfile=259

Share this post


Link to post
Share on other sites
Thanks BobB for the fast answer... But that doesn't solve my problem. I have to read serial strings in the format $xxxxxxxxxxxxxxCR where "$" is the start-code and "CR" is de end-code. "xxxxxxxx" is the data with an variable lentgh. To read this is very easy aswel with protocol macro as with RXDU(255) function. My problem is timing. It seems I can't read the data fast enough from the scu-card buffer with a cpu cylce time about 20ms. I need to execute de pmcr every 1ms. I hoped that was possible with sheduled interrupts. But that does not work with PMCR and RXDU. Another option is to execute the PMCR once en keep this in an neverending loop in the scu-card itself by implementing an 'goto 0'. But in that case I will face the same problem that i'm not fast enough to get all the data in de plc-memory. And I have to start other PMCR's onthe same port also (to send data) and when using a neverending loop on the read PMCR it's not possible to break this loop. Edited by gftbak

Share this post


Link to post
Share on other sites
I would be very surprised if you will be able to read that fast over a serial connection anyway. Even reading across an Ethernet IP network is not that fast - I have a job where I am doing this and the Ethernet scan time is over 20ms. Good luck.

Share this post


Link to post
Share on other sites
Ethernet connection is the new way I'm gonna try. I am connecting wit a autronica autrosafe fire detection central. Until now I tried to use the serial interface it provides, but it has an ethernet connection also where the same message's can be provided. So I will install a ETN21 card in my test-system. I'm will try to use the ETN21 socket-service.

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