AngryRobot

MrPLC Member
  • Content count

    94
  • Joined

  • Last visited

Everything posted by AngryRobot

  1. What is the best way to get data from an NX102 (or any NJ/NX PLC) into Excel?  I've been experimenting with some OPC UA options, but so far the only clients I've been able to connect with don't allow exporting of data.  Does Omron have any sort of ODBA connection?
  2. If I use the PrgStop command to stop executing a program (say when a different model type or tooling fixture has been selected) is there a way to force the variables to clear?  By default they retain their last value.  
  3. Clear variables when program stopped?

    Local variables.  I have not tried it with the actual hardware yet, but in simulation mode they maintain their last state.   Edit: at least in the simulator, both local and global variables set in the stopped program retain their last state.
  4. 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?
  5. Data from an NX102 to Excel

    Any tips on how to write data to the CSV file?  I have an array of REAL numbers.  I can create and close the file just fine, but the data that gets written is just junk characters.  Do I need to convert the data to string?   EDIT: Converting to string and concatenating a ',' worked.
  6. Data from an NX102 to Excel

    I've used the NJ models with SQL capabilities before, but this machine doesn't normally require data logging.  We are wanting to do an in-house run off on the machine and log some of the test results to prove its reputability when our customer shows up; and I figure logging it right from the PLC will be easier than sitting at the machine and manually recording every number by hand then transcribing it into Excel. So FTP it is.
  7. Thank you for the link.  The code that Chelton posted at the end of the thread did exactly what I needed! That is very similar to what I was going to try originally, but when setitem didn't popup as an option while I was typing I just assumed the HMI didn't support it.
  8. Is it possible to change the dropdown list text on the fly?  I would like to assign each of the options in the list to string variables that my users can change.  I have an array of strings that store the names of parts and I want those strings to show up as the labels in the dropdown. Is there a way to access the object properties in VB?
  9. I have a structure named "Tests" with three BOOL members (Active, Passed, Failed).  I have another structure called "All Tests" with 12 "Tests" members. Is there a way to look into the structure All Tests and determine if any of the ".Failed" members is active?  
  10. Is it possible to setup Ethercat parameters from within the PLC program?  I am facing a situation where a machine is going to have changeable tooling fixtures and each fixture is going to have an EtherCAT device on it.  I am guessing they will need to be setup to look like the same node to the PLC, but they will have different physical IDs and different settings for some of the parameter fields.  They will be the same device so they will have the same parameter fields, just different values in those fields. I can also get these devices with EthernetIP as the fieldbus option.  In that case I would always have a network error because the PLC would always see one of the devices missing from the network.  is it possible to enable/disable Ethernet connections from within the program logic to avoid the error?
  11. I have finally gotten the chance to test this and I've got one issue.  I have no control over when the operator might disconnect the fixture cable.  I have it programmed with a "Remove Fixture" button that disables all of the enabled Ethercat nodes and prevents errors.  If the operator removes the cable before pressing the button though the disable function block will not disable the node, which leads to an EC error that can't be reset because an enabled device is disconnected. Does anyone know any tricks to force it disabled, even if the FB doesn't want to?
  12. This seems like it should be very simple, so I'm sure I'm just overlooking something.  When I create a global variable, I can click in the corner of the comment box and open up all of the sub comments for an array or structure for quick mass editing.   While programming I added comments to array of bool coils as I went and they were saved as local comments and not the global comments.  I want to open up the local comment sub menu so that I can copy and past them all to the global comment list, but I can't figure out how to access it... or if its even possible. 
  13. Thanks.  I'm pretty sure use global comment is the default, so I don't know how/why I unchecked it.
  14. I just stumbled onto this today, and I wanted to throw this out there in case someone else finds it useful.  You can use the ArySearch function to determine if there are any active elements in a BOOL array by setting the Key to P_On (or any other active BOOL variable). I've been using a union of an LWORD and an array of 64 BOOL for faults/alarms and looking at the value of the union to be <> to 0 to indicate an alarm is active.  Well, I have a machine that is getting close to going past 64 alarms; so I set out to determine if there was anyway I could use a larger array.Do Note though that this only works if you need to know if an element is active, or how many elements are active; it won't translate to a BCD value the way a union will. 
  15. Thank you!  That is what I assumed, but I wanted to verify.
  16. If I set a variable as retained, but then also set the initial value, does it re-initialize the variable anytime the PLC loses power, or only on a program change?
  17. Thanks!  Looks like that is what I need.  Luckily I think we've been able to redesign the machine so that I won't have an individual device on each fixture now, so it has simplified things for me.
  18. Addressing Bit Inside an INT

    It took me some time to get used to as well.  You are spot on with Sysmac having some quirks.  Once you get used to them though Sysmac really starts to feel like one of the best programming environments on the market- at least compared to Portal or Studio. I have gotten into the habit of just creating a BYTE, Word, Dword, and Lword union in each of my projects; and then I can just create symbols as whichever type I need as I go.
  19. Addressing Bit Inside an INT

    I still prefer using a union so that I can assign unique comments to each bit.
  20. Under each alarm table there are individual components like Name, Alarm ID, Alarm Code, etc.  I know these have to be saved as a VB structure behind the scenes, because the default alarm popup has each of these components on a different line; so its like they are using a text box and setting it equal to something like Alarm.Alarm1.Alarm_Code.  I just can't figure out what that structure is named or how to access it myself.  I'm still trying to create my own alarm popup window and customize it more than just putting an alarm display object on it and having everything in one row.
  21. DF7seg font

    Do you have Sysmac Studio installed?  If so then you should already have the font installed in your system fonts folder.  I'm not sure what the rules are concerning just giving the font away.
  22. NA screen acknowledge alarms on reset?

    Is it possible to access the alarm code?  I would just create my own display page, but I like being able to display the alarm code.   Edit: I guess I can just add them to a normal alarm viewer.  The layout on the pop-up screen just looks so much better than the alarm viewer objects though.
  23. Is it possible to have alarms show as acknowledged and close the pop-up screen when the expression that triggers the alarm is no longer true?  I like resetting the alarm with a PB in the PLC, and its a bit annoying having to also acknowledge it.
  24. NA screen acknowledge alarms on reset?

    I can't uncheck Acknowledge when I have the pop-up checked- but I still want to use the pop-up to display my alarm code.
  25. Does anyone know how you can access the USB drive from a VB script on an NA screen?  I need to run a script to create a CSV file, but I can't figure out how to direct it to the USB location.