Firehunter

Wrong values on FX3U

8 posts in this topic

This is my first time programming a PLC, so I probably make a lot of rookie mistakes.

I'm trying to upgrade a keyseater machine by exchanging damaged mechanical parts with new electronics. Because this is my first time working with a PLC, I ordered a cheap FX3U clone on AliExpress, just to try. I'm using a Structured Project in GX Works 2 for programming.

I already got some functions working, but I'm having a bit of trouble with encoder input en position output. I'm using function C250 for a quadrature encoder. This is actually C251 on the original FX3U, so there might be more differences between the original and Ali version. Sometimes C250 works, but sometimes it stays at 0 counts. My first guess, is there a way to "activate" this function? Or should it be always on? I see ladder examples using a coil to write K9999 to C251. But I'm using structured ladder. Is DMOV K9999 to C250 the right way to "activate" this function?

The second problem is D8340. According to the manual, this value is the actual step count of the step/dir output used by DRVI for example. I want to use this value to calculate the tool position. When monitoring this value in GX Works 2, the value is always wrong. Sometimes it keeps changing between 0 and 10 without any inputs or outputs changing. Sometimes a much higher value, don't remember what exactly, but also +/- 10. But what is even more strange, when I have this value on screen while monitoring, other values are wrong. Some closed contacts are open, some open contacts are closed and numeric values are wrong. When I scroll the D8340 label out of view, the values are good. See the attached screenshots. Is this a bug or am I doing something wrong?

PLC getallen 3.png

PLC getallen 4.png

Share this post


Link to post
Share on other sites

Posted (edited)

There is a difference between C250 and C251. 1-phase 2-count input & 2-phase 2-count input

To activate the counter use OUT_C_32 instruction

As for the monitoring keep in mind that the program is running much faster then you are monitoring. 
So many scan have been processed which changed some values.

Active open or closed is only what you programmed the depending on the value of the bit it will be filled blue. So a normally closed which bit is off will be blue filled

p.s. For real production i would not use a clone !!!!!

Edited by Gambit

Share this post


Link to post
Share on other sites

I know what the difference is between C250 and C251, but it's just different on this PLC.

I'm going to try the OUT_C_32 instruction. What's the difference between this and DMOV?

3 hours ago, Gambit said:

As for the monitoring keep in mind that the program is running much faster then you are monitoring. 
So many scan have been processed which changed some values.

But the changing values based on which labels/devices are in the view sounds like a bug? I'm trying to display the D8340 and ACTUAL_DEPTH values on the HMI, but there it just stays 0.

Share this post


Link to post
Share on other sites

 OUT_C_32  is needed to activate the high speed counter

Dmov is for the values  

Share this post


Link to post
Share on other sites

Does the OUT_C_32 has to be used once with a pulse signal? Or continuous?

Still wondering why D8340 seems to have a bug... does anyone know why?

Share this post


Link to post
Share on other sites

Check the How to use 2-phase 2-counting input counters C251 to C255 for 4-edge counting in the FXCPU Structured Programming Manual.

It has to be continious on for the X00- X07 inputs to be used for counting, When it is not on the couter is off 

 

Share this post


Link to post
Share on other sites

I don't know why, but it seems that I had not yet found/seen the Structured Programming manual. I had a few other manuals but not this one 😅. I understand the functions better now. Thanks!

The D8340 "bug" has also been solved! Just like the C250/C251 problem, I found out that the Chinese clone has a different device number for the actual pulse count. I used a switch for enabling a DRVI command while scrolling through the device list until I saw a value changing. For this PLC type I have to use D8132 instead of D8340.

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