Posted 29 Nov 2016 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. Share this post Link to post Share on other sites
Posted 29 Nov 2016 (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 29 Nov 2016 by Gambit Share this post Link to post Share on other sites
Posted 29 Nov 2016 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. Share this post Link to post Share on other sites
Posted 29 Nov 2016 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. Share this post Link to post Share on other sites
Posted 29 Nov 2016 "Drag" the Motor POU under Task_01 to make it compile. Share this post Link to post Share on other sites
Posted 29 Nov 2016 i try to drag into the Task_01 but an error occur. I'm using FX3U PLC. Share this post Link to post Share on other sites
Posted 29 Nov 2016 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. Share this post Link to post Share on other sites
Posted 29 Nov 2016 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) Share this post Link to post Share on other sites
Posted 29 Nov 2016 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. Share this post Link to post Share on other sites
Posted 29 Nov 2016 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. Share this post Link to post Share on other sites