Search the Community

Showing results for tags 'structure'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 9 results

  1. Structure Text REAL constant

    Hello. I'm having difficulties of how to write REAL constant in ST. For example (Gap1 is defined as REAL): Gap1:= UDINT_TO_REAL(P_Cycle_Time_Value) / +1000.0;     RETURNS ERROR ERROR:   Conversion cannot convert from Integer Literal to REAL I have also tried 1000.0 If I use:  Gap1:= UDINT_TO_REAL(P_Cycle_Time_Value) / INT_TO_REAL(1000);  COMPILES OK My question.. How do I write REAL constant in Structure text? I don't want to use  INT_TO_REAL anytime I want to do calculations with constants.. Thanks. BR.
  2. Hi, As part of developing an EtherNet/IP driver for the CLX family, I have the task of recognising tags that would ordinarily be represented as strings. With SLC/ML, that wasn't too difficult since strings were a pre-defined type found in files with a file type of 0x8d. With CLX, I understand that the situation is quite different, since a string now becomes just another structured tag like so many others. So, for instance, in my controller, and with the help of information gleaned from the LogixTagRead program, I can see that a request sent for one particular tag (which I happen to know is a string) returns me the following information: Tag type: A0 02, followed by, Structure handle: CE 0F, followed by, Length (DINT): 1A 00 00 00, followed by, Data (Series of SINT): 41 42 43 and so on through to 58 59 5A Now in one sense I am fairly clear how to interpret most of the above data -- but in another sense, I don't believe (unless I'm missing something) that it can ever tell me that this tag should be INTERPRETED as a string. What do I mean by that ? Well, the tag type of A0 02 simply says that this tag is a structure (because the top bit is set). Even if we were to unset the top bit, the value becomes 20 02 and I'm not sure if that has significance in itself. I'm not sure if the structure handle (aka template id) of CE 0F tells me anything other than the fact that this is a symbol type of CE 8F. I know that this field can be looked up and will tell me that this structure comprises a C4 (DINT) followed by data comprising a series of C2 (SINTs) where the number of SINTs is given by the value of the DINT preceding. And, of course, this makes sense in that the DINT value of 1A 00 00 00 is decimal 26, followed by 41 42 43 ... 58 59 5A which is a 26-character string ABCDEFGHIJKLMNOPQRSTUVWXYZ. This is all correct. So whilst this LOOKS like a string, how can my code be sure that it is actually to be INTERPRETED as a string ? At the end of the day, it is only a DINT followed by a series of SINT; this doesn't of itself mean it is a string. Is there anything in the tag type or structure handle which actually identifies this as a string-type tag ? Thanks.  
  3. Hi, I'll apologise for asking noob questions before I start - please don't shoot, but searching for existing answers on this is very difficult for me as I'm not confident in what search terms to use to get some appropriate results! And I'm afraid there are several aspects to my question too. I'm a software developer tasked with extending an existing EtherNet/IP driver. The driver already has the ability to identify atomic data in a range of AB controller models (by specifying a file type, file number, element and sub-element). The driver can then issue the appropriate commands (at the different link layers) to read the values of that atomic data, and write new values back. I have some test hardware:  (1) Control Logix 1756-ENBT (2) SLC 500 1747-L551 (3) MicroLogix 1400 1766-L32BWA (4) CompactLogix 5370 1769-L30ER I need to access these units remotely over a VPN. I've been able to change the subnet & gateway of (2) and (3) so that I can now see them over my VPN but have yet to work out how to do this for (I) and (4). None of the controllers are set for BOOTP but, to be honest, I'm less concerned about an answer for this than I am about other stuff that follows in a while! I also have a valid licensed dongle which allows me to load RSLinx, RsLogix 500 and Studio 5000 software - for some reason, the RSLogix 500 hasn't activated and I only have a day's grace period left but, here again, I hope to find a resolution to that outside of this forum. So, to the nitty-gritty.... I'm a confident, mature developer but I have absolutely no experience with PLCs and their terminology - and I admit I haven't been on any training courses. It will take me long enough to figure out protocol/command formats without the added burden of understanding the PLC programming processes, different pieces of Rockwell applications software and their associated plethora of documentation. In short, my task is to extend our driver to read and write non-atomic data types, i.e. structures and arrays. As a general concept, naturally, I know what a structure and an array are, but not specifically in terms of my test hardware's existing data files. I'm assuming that my easiest approach is to create a couple of simple structures and arrays in the existing test hardware using the Rockwell apps, at which I point I then have an odds-on chance of working out the command packets to put in my driver to read them. I believe that, to read non-atomic data structures and arrays like these, I need to use tags to address the data - if I've understood that correctly. Later on, I could then look at how I put together command packets to write to those structures and arrays, but I want to walk before I run. At present, I have fumbled my way through setting up a driver in RSLinx to access test hardware items (2) and (3). I can even run up a data monitor for both controllers, and can see various atomic data such as integers, booleans, etc. However, I'm guessing RSLinx doesn't let me set up structures and arrays. I assume that is done through either RSLogix500 or Studio 5000 -- but I have absolutely no idea how to do it or what I'm looking for. And the other aspect that's confusing me is that these two pieces of software are limited in the controller models for which I can start a new project. If someone could just give me some idiotproof pointers to step me through this, it would be fantastic. Thanks in anticipation.
  4. Is there any instruction in Sysmac Studio Structure text to detect rising Edge (DIFU/DIFD) ?
  5. Omron Eip

    I need to read and write to the omron CJ2 series PLC through CIP. I am able to send the List service and register session packet and also getting the expected response. BUt after that I am not been able to send the read and write request correctly. Let suppose I have to read the 15th location of DM area so can anyone help me out especially about the packet structure of read and write request.  And the important point is that I must have to use CIP not FINS. Thanking you in advance.
  6. UDTs to Custom Data Structure

    I have a reference HMI project that has many variables that have an Invalid data type. We are one by one trying to re-create the data types that are missing, but so far there is no easy way that I know of. Currently I re-create the UDT from scratch in a scrap offline project. (based on just looking at the variable elements in the ref project. Export the UDT to .XML file Import the UDT as a new custom structure into the toolbox At this point I can drag the structure from the toolbox into my variable list, and it creates a variable with what looks like a good structure. What I cant figure out is how to easily re-assign the old variable the new custom data type. Since the old variable is used all over the place, it cant be deleted, and if I rename it it changes every reference to it that exists, so that doesnt help either. The image posted shows the old variable "H_Header" and its properties as invalid type (also shows red X in the icon). below that is a new variable with the new data type. (no Red X). If I could delete H_Header I could then just rename the new variable to the same, but I cant because of its use. If I could change the data type from Invalid to H_Header, that would work, but its greyed out and wont let me change it. Any help appreciated    
  7. Hello Everyone, haven't roamed here for a while.   So I'm having a little trouble using the Structure Data Type in Sysmac Studio/NJ. As an independent tool, it is powerful to create user data types, such as Ethernet/IP Tag Link to V680S RFID or any other EIP equipments. And it is way more powerful than the CJ2, since it has the ability for user defined offset, which CJ2 can't do.   But the problem is we cannot move/copy the content of the members to any other standard types. For example, I have a structure with 8 BYTE type members. Then I need to send those out via UDP or TCP/IP comms, which Function Block requires BYTE[] data type. Unfortunately data movement instructions such as MemCopy and AryMove didn't work at all to do the job. This was easily done in CJ2 since we can access each memory content directly. Currently I already resort to use customized Functions which will translates the Structure into BYTE[], but that would mean for every different protocols, I need to create a different Function.   I have seen this problem posted somewhere in the SS/NJ Improvement Request section, so I wonder has anyone know any update about this matter? Haven't checked the latest update yet (SS v1.14), but I'm certain that in SS v1.13 this feature is still unavailable.   Thanks!!!
  8. Logix data tag structure

    Can anyone advise if there are data structure #s associated with each of the data types in Logix?  Example if it is a Bool, I believe Logix advises it is a 32 bit number.  But is there an "under the hood" data type reference number for each Logix data type?  I.E.  if it is a Bool, that is a RA data type #1, if it is a DINT, it is a RA data type #2, etc.  
  9. Hello: I'm not sure how to go about creating the structure of this program, would like some ideas/help. I have a program that checks/reads 8 analog inputs and compares each input against 4 different settings, if the value is outside any of these settings the program runs a subroutine to send out an email for (Alarm/Event) notification for that particular input. The way the program is structured now is that it reads analog input 0 first and checks against the settings if the reading is not in range it will call a subroutine to send out email for that sensor(analog AI:0.0) then it will return and read for Analog input #1 and check reading and if it needs to it will call another subroutine to send out email for that sensor(analog AI:0.1) and so forth. What I need to add, is a way to count how many times a sensor(input) has sent the alarm email because I want to limit this to 5 notifications after that, stop sending emails. Now this has to be done for each sensor(input).(Note: I would also like to have a timer involved so that it will only send emails about every 15 minutes for 5 counts.) I need this because the plc will send out emails until the error for the sensor has been corrected, this could take a few hours and if I don't have some sort of control, that would result in 1000's of emails being sent and world probably get shut down for spamming. Would like some ideas on how I should go about this. I am using a micrologix 1100 and rslogix 500 software. Thanks