preset and current value

juan

Member
Join Date
Apr 2003
Posts
50
Can anybody help us? We are using a HMI written in VisualBasic where we can fill in our desired positions. This data is transmitted through pc/ppi cable. If I make an interrupt each time the data is ready(by pushing an button on the pc) , how can I read this data(my position), because I want via the pulses coming from the encoder, counting with the High Speed Counters untill the desired positions are reached?

Thanks
 
Juan,

I am not exactly sure whether you are asking how to program the PLC to use your sent data or how to make the PLC continually send a "real time" reading back to your PC, so let me try to answer both.

To make the PLC initiate a stop at the desired position you must:
1) do a write statement in you VB program to a data register in the PLC.
2) do any necessary conversions to the data so that you can do a direct comparision of your target value and the input from the encoder.
3) write a comparision statement in the PLC to the effect: If Encoder Value >= Target Value then Set Stop.

Now, if you want to continually display the "real time" current position of the encoder, you will probably want to program your VB application to snag the Encoder Value from the PLC on a regular interval (every 1/2 second, for instance). I doubt you will want to make this a really short time span since this could create a bit of a burden on your PLC and the process itself.

Hope this helps.

Steve
 
some information

It is the first you are talking about, Steve, but where can I find some information about the way of storing, comparing, for example in vw or something????

Thanks
 
Its been a long time since I have used VB to interface with a PLC, but here is a general description of what you need:

1) A VB application that generates/records a value (target)
2) An I/O server to create the communication between VB and the PLC (there are many but KepWare is one source)
3) A PLC program that controls the I/O

If you already know how to write a VB application, you should be able to create the value you want to send.

Once you have selected and purchased an I/O server (I am not aware of anyone offering a free one) to interface with your PLC, there should be instructions included to tell you how to properly configure the communications.

If you already know how to write PLC code, all you need to do is create a simple compare statement.

Are you new to PLC programming and/or VB? Each piece can be pretty involved if you have little or no previous exposure to it.

Steve
 
thanks

The VB program is already written and we are sending some characters and those characters we are receiving ind SMD2. But for example we fill in our program I want to go 20° forward, we fill 20° in a window and push on the "go" button, this button generates in our program a 'V', and via an interrupt and the SMD2 I will receive this. If I receive a 'V' I'm moving to the right. In the VB program it is programmed that way we send each time a 'V' as long as the desired greater is than a counter that increments when we send back a 'v' each time we are turned one degree. Do you know how I can send a V from the plc to the pc?vb500??
 
I am afraid I am a bit confused by this last relpy. You say:

this button generates in our program a 'V', and via an interrupt and the SMD2 I will receive this.
Is this "V" a value? If so, is it safe to assume it is a value of 20 in your example?

I really need to better understand what you are telling me.

By the way, what make and model PLC are you using?

Steve
 
let me explain

I'm using a Siemens S7-200 plc. With the SMD2=='V' then I'm sending the frequentie variator forward. if I did one step forward I send an 'V' to the pc so a counter increments with one,... and this repeats untill we are in the wright position
 
Ok, let me see if I understand how you would like this to work:

When you want to issue a "move" command of 20 forward:
  1. you set the value in your VB application and press "Go".
  2. The PC sends a single character "V" in Freeport Mode to the S7-200.
  3. The PLC sees this and tells the drive to move "1" increment and then clears the Receive Character Buffer (SMB2).
  4. Once the drive has moved "1" increment, the PLC sends a signal to the PC that the move is complete.
  5. The PC then sends another single character "V".
  6. This process repeats 19 more times.
    [/list=1]
    Is this an accurate account of what you are wanting?

    Steve
 
Confused also

From what I see, which is not much, you have a VB app that works as an HMI and you want to set a value with this that tells the motor how far to move...ie 20 would be a 20 degree move.

Steve and many others are far better at this than I am but I will offer an approach that may give you some ideas.

Have the VB/HMI give a value to the plc, this value would be stored in a word address, lets say VW100. Since you are using an HSC and encoder I will assume its an incremental encoder. Lets say the device starts at a "home" position which would be "0" in the Accumulator of HSC file. You can do a compare of the 20 that is in VW100 to the value in the HSC accumulator (usually designated HC0 or HC1 etc)to stop the motor in position. There must be other actions/conditions that enables the HSC and starts the drive. This is a simplistic example of HOW TO. Note that to determine counts per degree for the device you will need to know the count per revolution, since there are 360 degrees in a circle..ie one revolution you divide the counts by 360...AGAIN though this is a basic answer but should offer a direction to follow.


The "V" and SMD2 has thrown me. Did you mention a MicroMaster drive in another thread? Is that suppose to be SMB2? The freeport recieve character? The instruction for transmitting is XMT and for recieving is RCV.

I would suggest obtaining catalog # C79000-G7076-C230-2 S7-200 Programmable Controller System Manual.
http://www4.ad.siemens.de/csinfo/li...search.asp?&Query=C79000-G7076-C230-2&x=8&y=9
 
Last edited:
steve

I think you thinking in the right direction. But now: the plc has two different connections, one to the frequenty variator and one to the pc. Can I choose for example that the vb500 is reserved to the pc, and VB100 for the frequentie variator or something like that?

Thanks
 

Similar Topics

Hi there I'm guessing this is a straightforward one but after much experimenting I've been unable to find an answer. The software is TIA V16...
Replies
5
Views
2,356
Processor: 1769-L30ER; Logix 5000: v32.02 I have an AOI that's been used in previous applications without issue, and have added a TON...
Replies
6
Views
2,774
Good Evening , I’m using a Shift Register ( BSL ) and I’m using a timer to shift these bits . At the moment my timer is 100 ms , but I...
Replies
4
Views
1,845
So I am running into something i have never ran into for some reason i cant change the preset on a timer every time i do it just reverts right...
Replies
9
Views
2,087
Hi all I was being really clever and suggested i add a list of preset settings to a line which every1 seemed thrilled with. however the amount of...
Replies
10
Views
1,894
Back
Top Bottom