AngryRobot

MrPLC Member
  • Content count

    58
  • Joined

  • Last visited

Community Reputation

2 Neutral

About AngryRobot

  • Rank
    Sparky

Profile Information

  • Country United States
  1. Anyone have much experience creating IAGs?

    I think I came up with more crude solution, that I'm not as worried about zapping the HMI performance with. I created a variable in the HMI called CLOCK that maps to the 100ms clock pulse in the PLC.  Then inside of the IAG I set the expression that calls the sub to (Run AND Clock).  So now it only calls the Sub when the page is displayed, and the clock pulses.
  2. Anyone have much experience creating IAGs?

    Someone here at work suggest multi-threading as well, and they were also worried about the performance affect it might have on the HMI.   This will be going into an IAG object, so it isn't very easy to call subs from page displayed/hidden events.  Right now I set a BOOL variable when the page is displayed, and that is passed into the IAG and used as a conditional expression to call the sub, and then I reset the variable when the page is hidden.  So I think, using  your example, I could  create another variable that would be set when the page is hidden, and reset when the page is displayed, and then use that to call the end loop.
  3. Anyone have much experience creating IAGs?

    So part of the problem is my familiarity with ST versus VB.   I didn't think about the subs only running once when called.  So that is where most of my problem is.  I'm only running the sub once when I load the page, and never again to change the value of the label when the variable changes.   I have six servos on this machine, so six different IAGs or pages to display the faults and other info.  What is a good way to continuously call a sub, without sticking it in the global events table and calling all six all the time, even if the page the sub is on isn't being called?
  4. Anyone have much experience creating IAGs?

    Yeah, it seems I wasn't calling my sub like I thought I was.  I am now able to get it to run the sub; the sub just isn't doing what I want.  So now I've got some sort of issue interfacing the input variable to the VB code.
  5. I am trying to create an IAG to store and display some alarm messages for a servo drive.  I wanted to do it in an IAG in order to make it easily reusable; but so far I'm not having much luck getting it to work. I created an input variable that will have the error number stored as an INT or Short; then I added a VB sub to run through a CASE statement in order to write the messages.  I've tried writting them to a String variable that I would display with a data display, but that didn't work.  So then I tried just writing the string directly to the object parameter (ie: Label0.Text), and that doesn't seem to be working either. Could it be that the sub isn't getting triggered?
  6. Is it possible to export any of these for use elsewhere outside of the library? A colleague and myself and have started working on several structured text functions and FBs that we were hoping to export for easy use between us, without having to export and share an entire library.  
  7. Interfacing Union to NA alarm expression.

    I didn't realize to specify arrays on the NA you had to parentheses instead of brackets... that is most likely the cause of my problems.  When I tried to specify ".BitLeve[0]" in the user alarm setup, that is what was causing the compile error. Well, using  Solheim9's solution I've already finished programming the alarm section, and I don't want to spend the time going back and changing all of my outputs now.  At least I know for the future.
  8. Interfacing Union to NA alarm expression.

    Solheim95,  I played around a bit with your second example and made a function block that handles all of it, and then nested that function block inside of another one that handles a lot of machine status and common logic.  It works perfectly! Thank you!  
  9. I have a union that I am using for my faults, but when I attempt to set the NA alarm expression to the union BOOL I get a compile error.  The union is an array of 64 BOOL and a long word. I assume the NA can't process the array portion?  IE: FLT.Bit[0]   Is there any work around to this?  I hate going back to using standard tags, because then there isn't an easy way for me to identify if an alarm is active (so I have to use a bunch of contacts in parallel)- that or just write a value to an INT and lose the ability to show multiple alarms. 
  10. UDTs from a Library Project

    Thank you!   I expected that they would show up under the data type tree, so when they weren't there I just assumed they hadn't been imported.  Now I guess I just need to keep a sticky note near my monitor with the names of all my data types. lol
  11. Is it possible to import my user created data types from a library project?  I have created a library where I am storing and updating my UDTs and function blocks.  When I add that library to a project my function blocks show up on the tool pallet as expected, but I cannot figure out where my UDTs are.  Is it possible I'm missing a step when creating the library and not saving them?
  12. Multiple word values in a union?

    That did the trick!
  13. Is it possible to have multiple bool arrays and corresponding word values in a single union? Say I want to create Test_Union, with an array of bool called BitsA and word value WordA;  and also BitsB and WordB- and keep the word values separate.  Is this possible?  Can I create a union of two unions? I know I can technically create an union with multiple arrays and words, but BitsA would affect WordB and vice versa.
  14. What would be the best instruction for setting multiple non-sequential bits in an array?  I have an array of user defined data that is storing part information for a palletized line.  Normally I set these bits individually based on what pallet is as a given work station.    IE: [SET Part_Info[Station_1_Pallet_Number].Part_Failed] But an occasion has arisen where I want to set a bit in every one of the UDTs within the array at the same time.  So when it is time to change part types I want to set the "Change" bit within every UDT at once.  And since this is the same bit within the UDTs it will be the same bit of every word in the array but they won't be sequential.  So "Part_Failed" might be at D3000.03 for pallet 1, and D3003.03 for pallet 2, D3006.03 for pallet 3, etc. Is there an instruction that would let me set the third bit of every word for X amount of words?
  15. Turn 8 inputs into a number?

    Thank you!  The transfer bit instruction did the trick!