Visual Components' Community

New Thinking for Factory Simulation
Welcome to Visual Components' Community Sign in | Help
in Search

Python versus COM

Last post ke, loka 22 2008 11:23 by Janne. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • pe, elo 15 2008 17:14

    • Janne
    • Top 10 Contributor
    • Joined on pe, helmi 22 2008
    • Visual Components HQ
    • Posts 21

    Python versus COM

    Python and COM serve different purpose to each other. Com serves for communication purposes and python for the simulation runtime. While this may seem superficially the same theres a lot that the internal python does that you cannot do with COM, the opposite also holds true.

    So use python when you design run time logic and simple extensionit runs inside our execution environment.Pythons function is to be easily transported and easily edited by users.

    Use COM when you need to embed things into your own application, need extensive communication and new gui items. Or when you need iteraction outside simulation, tools that require deep sytem functionality etc etc.

    Filed under: ,
  • ke, loka 22 2008 9:15 In reply to

    Re: Python versus COM

    Can the object inside the 3DCREATE change value in COM progamming? I mean, when simulation is running, the jog info can gives reading to COM. For example, when we moves robot joint, value in COM interface also change.This means value depends "object drive the sequences" and not "sequences drive object".

    "ENGINEERING THE NEXT BREAKTHRU"
  • ke, loka 22 2008 11:23 In reply to

    • Janne
    • Top 10 Contributor
    • Joined on pe, helmi 22 2008
    • Visual Components HQ
    • Posts 21

    Re: Python versus COM

     Yes, that would be the purpose. As to what drives what depends on how the program is done, both are equally possible. Simply put querying a value always returns the current value because that's what is stored inside the system and likewise setting a value always sets the current value. So if the simulation is running and you query a value it will represent the value currently in the simulations state, the other way around it would imply that a simulation would react to that value (but only if the values is not subsequently overridden by the simulation).

     If on the other hand a value changes and the COM program is not querying it then it wont know a change has happened, much like python. This said, you can however instruct both python and com to listen to events and get a notification when things have changed, thus your program can know to query a value again on change.

     But we are veering of from the topic of the original post. Just because COM can do many of the same things python does does not mean you will want them to do the same things. For one python is contained in a way that makes it much safer to use, in COM you can crash things very hard with your code. Also python is partially safe for something that is in a way a multithreading environment. Whereas your com program does not have these safeguards, you need to account for this yourself.

     

Page 1 of 1 (3 items)