MrPLC Member
  • Content count

  • Joined

  • Last visited

Everything posted by DigitalFarmBoy

  1. I'm having trouble specifying a memory location using the AT specification for an array in the Global Variable tab. I've tried a number of different ways to do so, and searched around online but haven't been able to find anything about how to do this. All I have to go from is the rather cryptic "AT specifications are specified separately for each variable. Set them for all elements and members of array, structure, and union variables." from page 6-62 of the Software User's Manual (W501). That seems to imply that it can be done somehow, but I am not sure how. Right now I have created array elements as independent variables, and then use a FOR loop with a CASE statement to put the proper variable into the array for use later in the program. This doesn't seem particularly efficient, and I have to imagine there is a better way. Any advice on this is greatly appreciated. Thanks!
  2. AT Specification for Arrays

    I am aware of using the % symbol for addressing with a single variable, but wasn't sure how the program handled that when used for an array. In the example above, I am assuming that the PLC will assign testArray[0] to location %W0, testArray[1] to %W1 and so on, is that correct? This was my initial assumption but... I built a quick sample program where I created a single UINT and an array of UINTs and mapped them both to fixed memory: When I run the simple program (sets Test := i in a FOR loop through 16 and sets ROS_OP_MODE to 1), I looked at the variable watch, and while it shows my AT specification for the single UINT (%E0_0), it doesn't show any AT specification for the elements of the array. This is why I wasn't sure if I was defining the array AT specification correctly. I don't have hardware on hand currently, so I can't verify if the simulator is not showing this correctly or if the array isn't actually mapped to the memory as expected. Either way, I would like to be sure before I spend a bunch of time programming and then find out that it does or doesn't work. I'm working with a couple HMIs that talk to the PLC using the FINS Ethernet protocol, so I need to map variables used by the HMI to specific memory locations in order to access them remotely.