Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Automation Systems
  • Human Machine Interfaces (HMI)
  • NA

Changing Viewport Lengths via an Onscreen Button on a NA Screen

Written by Nick Lim

Updated at August 7th, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

A frequently asked question concerns the process for adjusting the viewport length of a trend or line graph using an on-screen button. This functionality allows users to view different time scales without modifying the underlying code. While Sysmac Studio does not provide a built-in method for this adjustment, it can be accomplished by modifying the property through a subroutine written in Visual Basic.

Process

Step 1: Set up your Trend Graph/Broken Line Graph and buttons you wish to use to change the Viewport Length. 
Step 2: Click the following button to view code for the page.

Step 3: Create a Subroutine using the following format

Sub changeTrend5
    TrendGraph0.ViewportLength = 300
End Sub

Sub changeTrend24
    TrendGraph0.ViewportLength = 1440
End Sub 

 

Step 4: Setup your button to call the subroutine we just created.

 
 

Example Code

An example project is available here:

https://static.helpjuice.com/helpjuice_production/uploads/upload/image/10332/direct/1722916381409/Viewport%20Length%20Change%20Example.smc2

 
 

 

na viewportlength viewport length time scale visual basic

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Ethernet setup for a CP1L-E and a NB screen
  • Connecting your NA5 HMI to a CS1G/H PLC

Definition by Author

0
0
Expand