ct8356 Posted October 3, 2014 Report Posted October 3, 2014 (edited) Is it possible to define the size and/or position of a button (or any icon) with an equation? For example, if I wanted to have four buttons along the bottom of the screen, I would like to be able to define button 2 a bit like this: button2_x_size = screen_x_size/4; //Set the width of button 2 to 1/4 of screen width. button2_y_size = screen_y_size/8; //Set the height of button 2 to 1/8 of screen height. button2_x_position = button1_x_size; //Set the x-position of button 2 to the right edge of button 1. button2_y_position = screen_y_size - button1_y_size; //Set the y-position of button 2 to the top edge of button 1. I would like it in equation form, so that if I decide to change the size and position of button 1, the size and position of button 2 will be updated automatically. (In fact, is it possible to simply write all the layout logic in some kind of text editor?) Edited October 3, 2014 by ct8356
Crossbow Posted October 4, 2014 Report Posted October 4, 2014 Not that I know of. But I am not familiar with what can be done in the script language. 1
ct8356 Posted November 21, 2014 Author Report Posted November 21, 2014 Is it possible to modify the script language for a CX designer file?
BITS N BYTES Posted November 21, 2014 Report Posted November 21, 2014 NS Macro command "MOVEPARTS" MoveParts.pdf 1
Michael Walsh Posted November 21, 2014 Report Posted November 21, 2014 I think that you could use GETPARTS to determine the size of the button that you want to make the other buttons copy and then MOVEPARTS to change the size of the buttons. 1
ct8356 Posted November 24, 2014 Author Report Posted November 24, 2014 Thank you for the advice. If I am working in CX Designer, where do I need to input this command?
BITS N BYTES Posted November 24, 2014 Report Posted November 24, 2014 (edited) There are a three primary methods to access NS macros, "Project Properties", "Screen/Sheet Properties" and the "Macro" tab associated with screen objects. "Project Properties" -> "Macro" offers the most options to launch macros, "When Loading a Project", triggered by Alarm/Event and "On change of an address value" [This selection has 10 Boolean triggers and 10 Value triggers" Screen/Sheet macros can be launched when a screen is Opened, Closed or both Opened and Closed. Likewise screen object macros can be set for "Touch ON timing", "Touch OFF timing or both. Note that is you are using multifunction objects that launching macros is via the "Special" tab associated with the multifunction object. It is up to the developer to define the macro triggers and what macro should run. Have you downloaded and studied the NS Macro manual? It is a bit brief but should get you in the right direction. Edited November 24, 2014 by BITS N BYTES 1
IO_Rack Posted November 24, 2014 Report Posted November 24, 2014 This is a clip from the Macro Reference manual. This is found in the CX One Start menu (Omron > CX-One > CX-Designer > Manual).
IO_Rack Posted November 24, 2014 Report Posted November 24, 2014 ... just as Bits N Bytes stated. He beat me to it.
ct8356 Posted December 15, 2014 Author Report Posted December 15, 2014 I have tried writing MOVEPARTS(0,1,1); in the project property macro called "When loading a project". I hoped that this would move the label with ID "LBL0000" to position (1,1) when I press "Tools > Test > Start testing offline", or when I reload the project in CX Designer, but nothing happens... Am I misunderstanding something?
BITS N BYTES Posted December 15, 2014 Report Posted December 15, 2014 Macros don't run very well in test mode. Use the physical NS.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now