Sign in to follow this  
Followers 0
Tomy

Problem with interrups (PLC, FX3U32M)

6 posts in this topic

I would like to use instruction DPLSY (1 pulse 50kHz), using interrupt of timer 1ms (I601). I have problem with start of instruction in every period. When IL interrupt code is: LDI Y000 DPLSY K50000 K1 Y000 LDI Y000 DPLSY K50000 K1 Y000 LDI Y000 DPLSY K50000 K1 Y000 I obtain: first int. OK, second int. OK, third int. OK, fourth int. EMPTY and next round... My question is: Can I realize my task properly (is any way to fire DPLSY every interrupt)?

Share this post


Link to post
Share on other sites
Not clear what are you trying to approach by executing the instruction 3 times with 1 output pulse each, but the instruction should not be subject to its own output bit. As soon as the PLC I/O refresh reads the Y0=On, the instruction will not be executed and it will be a dropout in the output pulsetrain. Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
I have to change input EN to restart DPLSY. When input EN is still close I can generate pulse only during first interrupt. I tried put on input EN marker M0 with proper logic (without success). Only with Y0 it is "working". Speed output Y0 is update "on line" (but I have tested REF_M function too). On start interrupt Y000==0. I tried code: LD Y000 DPLSY.... LDI Y000 DPLSY.... (off DPLSY and next On DPLSY) Result is the same like first I think that my problem is non-realizable (in this way, on standard PLC)

Share this post


Link to post
Share on other sites
Once again: What are you trying to do? And why this is done in interrupt? Is your goal to generate one output pulse per interrupt?

Share this post


Link to post
Share on other sites
My task is generate pulse (length=5...10us) with period=1ms (aside from (independently) cycle time) using FX3U. Cycle time will be about 30-50ms. Is any way to do it without interrupts?

Share this post


Link to post
Share on other sites
Try in the interrupt (not sure it will work): LD M0 DPLSY K50000 K1 Y0 LDI M8000 DPLSY K5000 K1 Y0 M0 is a condition for pulse generation. You do not need the PLSY instruction to generate a single pulse in interrupt: LD M0 SET Y0 REF Y0 K8 LD M8000 RST Y0 REF Y0 K8 If the resulting pulse is too short, add any dummy instruction(s) after the LD M8000. It may be done without any interrupt, by using PLSY in the main program: LD M0 PLSY K1000 K0 but these pulses will be 50% duty ratio. Edited by Sergei Troizky

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