MamoJaLatam Posted June 17, 2018 Report Posted June 17, 2018 Hello, I'm new to PLCs, now I learned about the "." operator, but it seems limited to specified registers only. So, for example, this works: D100.1 := 1; Question 1 - Is it possible to somehow access a specific bit of a label? Something like: myLabel.1 := 1; Question 2 - Same, but this time with Z registers: Z1 := 1; myLabel.Z1 := 1; Both examples throw a parser error. For now I'm sticking to assigning label value to a register, THEN changing the bit, THEN assigning the changed register back to my label, but it just looks ugly. Is there a better way to solve this? I'm using FX3G series.
Inntele Posted June 17, 2018 Report Posted June 17, 2018 No. If you want to check a specified bit of the word, you should move the word to the bit memory. LD TRUE MOV D200 K4M200 LD M204 OUT Y0 The index registers can not be used for this purpose too. It can be done by a complex way: LD TRUE MOV D200 K4M200 MOV K1M200Z K1M200 LD M200 OUT Y0 Read the programming manual carefully. There is written all.
collinsd70 Posted June 17, 2018 Report Posted June 17, 2018 If you have access to predefined Mitsubishi Functions- you can also use the conversion to Bit Array- this is what I normally use, then specify your Tag[x] where x is the position of the bit you wish to analyse. Here is an example for a 16-Bit Integer BitArray.bmp
Inntele Posted June 17, 2018 Report Posted June 17, 2018 collinsd70, INT_TO_BITARR 16 = MOV Dxxxx K4Myyyyy. It's just an IEC interpretation of MELSEC command instruction.
kaare_t Posted June 18, 2018 Report Posted June 18, 2018 You are correct that "." are limited to specific addressing only. The way "around" it is to define variables in global lists and then use the variable name (you can assign a labelname the address D100.1 for example).
Gambit Posted June 19, 2018 Report Posted June 19, 2018 I think you want to use an Array. Like than you can acces is like the following. Arrayname[Z0] But you do not have to use a direct indes register you can alos define a word Arrayname[index]
mavbr42 Posted July 27, 2021 Report Posted July 27, 2021 On 18/06/2018 at 10:40 AM, kaare_t said: You are correct that "." are limited to specific addressing only. The way "around" it is to define variables in global lists and then use the variable name (you can assign a labelname the address D100.1 for example). Thanks man, exactly the right answer that I was looking for ! Perfect :)
Saxony Thermal Posted April 18, 2024 Report Posted April 18, 2024 Hello, quick question, Using the syntax D100.1 as shown above works up to D100.9, but in GXworks3 D100.10 is a syntax error. These are 16 bit devices, how do we access the remaining bits like this?
Saxony Thermal Posted April 18, 2024 Report Posted April 18, 2024 Figured it out. D100.a is the tenth bit. So... D100.A D100.B D100.C D100.D D100.E D100.F It's in hex for selecting which bit to access, but the device number is decimal. Kinda funny but makes sense.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now