Jump to content
Xeall

Copy vector of outputs to MI register

Recommended Posts

Hi there,

 

I would like to know if there is a special function similar to the "Copy vector of inputs to a register" for use with outputs.

I would like to be able to copy the current state of outputs to a MI register.

 

An alternative would be to use a bunch of contacts and coils to link the outputs to MBs then use the "convert MB to MI" special function.

However this does not seem like the tidiest solution.

 

What I am aiming to achieve is having a screen to display the current state of all inputs and outputs.

The user will be able to navigate up and down the list of outputs and see their current state.

The aim is to achieve this using a single display in the UI.

 

I have already achieved what I want for the inputs.

Using the "Copy vector of inputs to a register" function, I can copy the selected Input value to an MI and display that on the screen.

 

It appears that there is only a "Copy MI to output vector" for outputs which is the opposite of what I would like.

 

I would really appreciate any suggestions.

Share this post


Link to post
Share on other sites

I don't see how copying a vector of inputs or outputs to an MI aids in displaying the state of inputs and outputs on the screen. Can you post a screenshot of what you're trying to do, perhaps one for the inputs that you've successfully done?

Share this post


Link to post
Share on other sites

Go back and look at the Help on "Copy MI to Output Vector" - it's full name is "Copy MI to Output Vector, Input Vector to MI".

 

You set SB 172 to get what you want.

 

Joe T.

Share this post


Link to post
Share on other sites

What I am trying to achieve is having one screen to display the state of all inputs and one screen to display the state of all outputs.

 

I have achieved what I want with the inputs. but have not been able to achieve the same thing with outputs.

For the inputs, I have a screen that looks like the following:

 

Input: 05    OFF

Air pressure low

 

The up and down arrows increase/decrease the input number. The selected input number is used with the "Input vector to MI" function to copy the state of the specified input to a MI which is then displayed on the screen as ON/OFF. The text on the 2nd line is just a list linked to the selected input number.

 

Specifically:

#2 (The address of the register used to display ON/OFF) into SI170

MI3 (The register containing the current input number) into SI171

#1 (only want to copy the value of a single input) into SI172

Set SB172 (to copy input to MI)

 

This setup for inputs is functioning exactly as expected, however I would like to replicate this screen with another that does the same thing with outputs. The problem is that the special function for outputs only copies a value to the outputs and I cannot find a way to copy the value of an output to a register.

 

As stated in my previous message, I could use a bunch of contacts and coils to link the relevant outputs to MIs and then use "Copy vector of MBs" special function to copy the currently selected output value to a register to be displayed on screen.

This does not seem as tidy as what I have achieved for the inputs.

 

I really just want to know if there is some equivalent to the "Copy Input vector to MI" function for outputs such as "Copy Output vector to MI".

 

Thanks

Share this post


Link to post
Share on other sites

SB 172 is definitely the correct system bit to set to copy inputs to an MI.
Below is the relevant section of the documentation:
 

Input to Register
+--------+----------------------------------------+--------+----------+
| SI     | Description                            | SB     | Function |
+--------+----------------------------------------+--------+----------+
| SI 170 | Address of MI containing integer value | SB 172 | I to MI  |
| SI 171 | Start address of bit array (vector)    | SB 173 | MI to O  |
| SI 172 | Amount of bits                         |        |          |
+--------+----------------------------------------+--------+----------+

Example: Input to MI, SB 172

  • Store the value 7 into SI 170, 2 into SI 171 and 4 into SI 172.
  • Set SB 172 to ON.
The program takes the status of I2 to I5, and changes the status of the respective bits in MI 7.
Bits in the target register that are outside of the defined range are not affected.

 

 
SB 172 is used to copy inputs to a register which is what I have used for the input part of my program. What I want is to copy outputs to a register. I cannot use SB 173 as this provides the opposite functionality (copy MI to outputs) to what I want (copy outputs to MI).

Share this post


Link to post
Share on other sites

Thanks Joe,

 

I think I will have to map the outputs to MBs manually as suggested.

A bit of a pain, but it will have to do for now.

 

Thanks for the input.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...