Jump to content

tmoulder

External Moderators
  • Posts

    196
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by tmoulder

  1. Hi Toddster

    Since the beginning, Unitronics has always recommended that a contact bit not be referenced in the same net as it's related output. Just recently, they added this as a warning condition in Visilogic, just to raise awareness of it.

    The reason for this has to do with how ladder nets are processed. When a net is processed, all input bits are evaluated, then output bits are set accordingly.

    If you set an output bit for MB 0 in net 10 (for instance), and use an input for the same bit in net 11, MB0 in net 11 will show as being energized, because it was set in the preceeding net.

    By contrast, if you set MB0 in net 10, then use a contact for MB0 as well within net 10, then the input bit will not show energized until the NEXT ladder scan, when the input bits of net 10 are checked again.

    As long as the logic works and causes no trouble, then all's good. But when you reach the point in your programming where you need things to take place in sequence within a single ladder scan, it can cause racing conditions and major headaches, because the processing does not behave in the manner you expect.

    For this reason, Unitronics recommends you avoid it entirely by breaking the net up and not using a bit in the same net as it's coil.

    TM

  2. I've got an idea for pop-up screens that will look really neat, but whenever I try to copy a screen from Visilogic (ctrl-alt-print screen) to use as a background image on another screen, it gets the scaling wrong.

    Two ideas:

    1. How hard would it be to have a menu option in visilogic to export an HMI to an image file?

    2. For a gold star, how hard to assign one screen to be the background image of another?

    Mind you, the background screen is nothing - just an image, no functionality.

    Thanks,

    TM

  3. Posted to blog.

    By the way, I want to take a second to thank Emil for posting that circuit. In mine, the 10K resistor is in series with both the Zener Diode and the Analog input. It got me to thinking about the voltage drop on the resistor and how it would affect the analog reading. But looking at his circuit, I see the input impedence on the input is over 1 Megohm, and so shouldn't pose any issues, a 0.01 attenuation. If you need more accuracy than that, you probably shouldn't be using a potentiometer :rolleyes:

    TM

  4. Hi Emil!

    That's a great circuit, and will work perfectly if you want to divide down to 10 V for the entire travel of the pot (0-10 VDC full range of motion).

    The problem I had was a bit different. I needed 0-10 VDC over a *potion* of the potentiometer, to get better resolution over a specific range of physical movement.

    This is tricky - you can't divide a potentiometer up, obviously. By applying 24 VDC to the pot directly (no R1), and adjusting the physical mechanism, I could get 0-10 VDC over the lower range of the pot while not allowing greater voltages to reach the AI and blow it.

    The problem is, it's always possible to get a situation where you do end up with >10 VDC at the pot. I had this happen while testing this - loose wire in the connector. Or when the pot is replaced or being adjusted.

    To prevent this, I used a zener diode and resistor to clip the pot output to 12.7 VDC maximum - overscale, but under smoke point. It provides a safety to the AI in this configuration.

    Thanks!

    TM

  5. No, I'm not doing yard work :rolleyes:

    I'm using a potentiometer to pipe 0-10 VDC to an analog input on an E1B snap IO board. The problem is resolution - the active portion of the pot is very small, and since the resolution on the analog input is also tiny, the active area encompasses all of 24 measurement units out of 1024 for full swing.

    To overcome this, I applied full 24 VDC to the pot, and set up the mechanism so the active portion ranges from 9-10 VDC. This brought my resolution to 92 units, sufficient to my purposes.

    The problem - at 15VDC or more, my input will go *poof*. :o Not a big deal right now, but in the future, if somebody changes the pot or spins it somehow without consulting me first, they may well let the smoke out.

    So I've been exploring ways to limit the potentiometer output by restricting it to 12 VDC or less. A zener does not seem suitable because I need the full voltage range below 10 VDC. I don't want to divide the voltage and lose resolution again. A diode clamping circuit I built was unsuccessful in tests. And lastly, all the documentation I can find on the web is all about clipping and clamping AC signals, not DC outputs.

    This seems like it would be a common problem in these analog circuits, and I was hoping somebody might have an idea about a solution.

    Thanks!

    TM

  6. I've noticed this too. The top frame of the visilogic IDE window (the "Windows" window) usually displays the name of the project currently open.

    I don't know how you could get the path in there, I've never seen that. But to display the name without the tilde (~), open visilogic first, then open the project from within it using the Open button or menu item.

    You get the ~ when you try to open a project by double-clicking it in Windows Explorer.

    TM

  7. Hi guys,

    In the bit operand world, we have 3 transitional bits to choose from:

    1. P input bits turn on for one ladder scan when the input turns on.

    2. N input bits turn on for one ladder scan when the input turns off.

    3. X output bits change state when the ladder net leading to them is true.

    I'd like to see a couple of new additions. I think somebody may have mentioned these before:

    1. !P and !N input bits turn off for one ladder scan when the input turns on or off, respectively.

    2. X input bit that turns on for one ladder scan when the input transitions, both on and off.

    3. !X input bit that turns off for one ladder scan when the input transitions, both on and off.

    These would mainly be useful in certain timing and comm applications, like looking for the toggle bit in a CanOpen NMT Node Guarding scheme.

    Thanks!

    TM

  8. Thanks Damian, that gives me a good work-around. But I'd still like to examine the busy bit behavior a little further.

    The busy bit is designated in the Config FB, and thereafter is controlled by the operating system. Since the bit is turned off when the command is completed, asynchronous to the ladder, does it turn on immediately when a command is issued?

    I wonder if the value could be trapped somehow. Emil seems to hint at that earlier, if I understood correctly.

    Thanks again,

    TM

  9. I moved the subroutine call for the Modbus Send / Receive to the last net of the main program, so the config is at the start of the ladder and the Tx/Rx is at the end. This left very little time for the data exchange to finish before the config FB was rescanned. Lo and behold, the busy bit works now.

    Not sure how I feel about this - the impression given by looking at the screen indicators is that "busy status" is never achieved. It would be nice to have this latched on for a minimum of one ladder scan.

    On the other hand, with a 6mS scan time, this would have the effect of slowing communications, so - I don't know. Just a tidbit I discovered the hard way. Tim Moulder - extreme PLC programmer :P

  10. I've cooked up a little Modbus IP Master module, and it works like a champ as a stand-alone. After I import it into my program though, the Busy bit configured in the Modbus IP Config FB never turns on. It doesn't matter what bit I use. I cannot change the bit from Visilogic by set and reset, so something is governing it. Data-wise, it seems to be working just fine.

    After several tests, the only thing I can think of is the scan time. This is a very large program and it shows a 6 mS ladder scan. Since Ethernet is such a fast protocol, I'm thinking the entire data exchange may be finishing before the ladder rescans the IP Config block, and so the busy bit is never set.

    Is this a possiblity?

    Thanks,

    TM

  11. Something I noticed while working on this:

    When choosing the filename in Write CSV, you give an 8-character name and choose the type separately. When using File Info though, it needs the name plus extension, with no option to choose file type. While I see the need to make this FB general-purpose, I had to devote alot of effort to generating a file name the File Info FB would recognize. Be nice to simplify this somehow, say by looking at the name only and not extension?

    Also, I tried to force an illegal value into my folder selection and check for an illegal folder before clearing the buffer. If it's somewhere in the OS, I didn't see it, but the File and Folder Info blocks did not update, and even with an illegal destination, reported no problems.

    Thanks,

    TM

  12. This is a revision to the buffered SD card subroutine I submitted before Christmas. It adds some new functionality (credit Stein Yair for explaining how the File Info FB operates), including file and folder selection, file and folder info, and a better layout of operands to make modification easier.

    It's free to all. Be sure to read the readme file for more detailed information, instructions for importing and use.

    Thanks,

    TM

    SD Card with Buffer Rev 1.zip

  13. Hi guys,

    I've said elsewhere that Visilogic's growth has been pretty organic, and could use some pruning. I second Damian's ideas, it's a pretty comprehensive list for improving the IDE.

    Also, I'll rehash one of my own: Add jump to HMI function to the button object as an option, and eliminate the links tab entirely. The Jump to HMI ladder function can handle jumps from within the program.

×
×
  • Create New...