Jump to content

Recommended Posts

Posted

Hi!

Anyone can help regarding this issue. I'm not able to monitor the Motor Block that I have created. there's no error either in the output screen but i'm thinking what is the cause of not running in the simulation which shows the Motor Folder RED  even it was compiled.

thanks for the help!

 

 

Note: I'm new in mitsubishi.

unable to monitor.PNG


Posted (edited)

The programs are still in Red so they have not been compiled. 

Drag them to a task. Compile and download to the PLC

Edited by Gambit
Posted

As @Gambit says. Make sure it's registered in the task/program settings (see picture). If it's not included there then it is just a program block that are not part of the compiled project and will never get simulated nor downloaded to the PLC. The point of the task/program settings is to have many POUs that you can easily swap in and out if needed without deleting the actual POUs.

task.png

Posted

In my Execution program task only the "Analog" block included. i try to delete first the "Main" block since it doesn't contain any program yet. but still the "Motor FB" is in red state even after compiling the whole program while the "RawToEng" block which is the same Function Block  with "Motor" is working fine.

 

11.PNG

Posted

Ahhh, the "Motor" is an FB/FUN. Then you need to actually use it inside a regular POU (you only have "Analog"). So inside analog just start to write "Motor" and then it will show up in the list of functions. Insert it into the program as you would insert any FB/FUN and use it... You have to actually make use of the FB for it to compile.

Posted

I see, I think this is the main cause of the error.

I'm trying to implement WORD data into BITS. Can you show me example of data manipulation for INT(or a table for data addresses in mitsubishi)? like (MW10 can work with M10.0 ...... in siemens)

 

11.PNG

Posted
2 hours ago, markyspicer said:

I see, I think this is the main cause of the error.

I'm trying to implement WORD data into BITS. Can you show me example of data manipulation for INT(or a table for data addresses in mitsubishi)? like (MW10 can work with M10.0 ...... in siemens)

 

 

As i Know you can't write like this Mstat.1, Mstat.2 and etc for symbolic variables. If you want this you have to write directly in register. (Show pic). I usually use for this aim BOOL array 0..15 bit and pack in one word by MOVE instruction with adding K4 before variable. (K=4bits moving, K2=8bits moving, K4=16bits moving). Also with this function you can bit by bit to spread the word.

D100 and D101 will have same value.

dat1.png.a189daa26911cc5ef8108bc973e3b95

dat2.png.13957e913ca81c3092da921246f3833

dat3.png.3d756102febeca1a5aceca503b24801

Posted

Or you can just move the array directly on the ouput pin (replace "Status_WORD" with "temp") of the FB just to modify @Clear.Minds great example a little... Then it's easier to use the array elements outside the FB and you save a couple of MOVE instructions...

P.S. Picture one works perfectly, but do not do this inside an FB!!! It will ruin everything that FB's stand for since you're taking away the flexibility of using the same FB multiple times! Never use mapped variables inside FB's.

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
×
×
  • Create New...