ducna Posted August 4, 2023 Report Posted August 4, 2023 (edited) Hi everyone, Continue in the journey to conquer MELSOFT. I created a function block with some in/out. The In/Out has data type Word. I can assign the index as D0Z0, D1Z0... But with In/Out having float or Dword data type, the program says the data is not suitable for variable. What can I do in this case? My fallback is to put it all back to the Word data type (that's stupid @@). Have a good day! Edited August 4, 2023 by ducna Quote
Gambit Posted August 4, 2023 Report Posted August 4, 2023 If the input output is defined as word than a word schould be connected. But it you want to PLC to process as something else you need to use the INT2..... instructions 1 Quote
ducna Posted August 4, 2023 Author Report Posted August 4, 2023 Hi @Gambit Thanks for your reply. I mean when I use D0Z0, the program automatically assigns the word data type on device D0. But actually I want to use data type Float or DWORD on memory area D0. Is there a way to specify D0Z0 with float data type? For example: FB_Unit (variable1:= D0Z0); Variable1 is input with floating point data type. Then D0Z0 is not suitable with Variable1. Quote
Gambit Posted August 4, 2023 Report Posted August 4, 2023 (edited) You should not use D0 anyway, That is from the past. Use variables instead of devices Create an array instead. Zo can be any defined word. MyArr[Myponter] Edited August 4, 2023 by Gambit 1 Quote
ducna Posted August 5, 2023 Author Report Posted August 5, 2023 Hi @Gambit Thats a great idea. The problem has been resolved. Thank you very much! Quote
ducna Posted August 14, 2023 Author Report Posted August 14, 2023 Hi @Gambit, A little error in the working process. I cannot assign variable with Z0 in LADDER program. Do you know any way? Thank you. Quote
ducna Posted August 14, 2023 Author Report Posted August 14, 2023 I have found a document it show that it is not possible to call array data directly in LADDER. https://www.youtube.com/watch?v=mAe_hcGpuAs Quote
Gambit Posted August 29, 2023 Report Posted August 29, 2023 (edited) When using arrays you do not need to use Z0. This was only used when using direct devices like D100Z0. Sorry for the late reply i was on holiday Edited August 29, 2023 by Gambit 1 Quote
ducna Posted August 29, 2023 Author Report Posted August 29, 2023 Hi @Gambit Because I need to handle about 1000 I/O and meet the project schedule. So I need register Z0. I noticed FX 3G CPU can't use array data type. I can't call tag in the statement. :)) Quote
Gambit Posted August 29, 2023 Report Posted August 29, 2023 Z0 is not neccesarry when using lables Sure you can. Are you using GX Works 2 structed type project ? 1 Quote
ducna Posted September 6, 2023 Author Report Posted September 6, 2023 Hi @Gambit Sorry for late reply. I'm using GX works 2 simple project with use label. I find it impossible to use the array data type in the ladder language. So I found a way to handle it gracefully with a ST language section. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.