# Programming

**URL:** https://forum.deltamotion.com/c/knowledge-base-examples/programming/32.md?page=1

[Latest](https://forum.deltamotion.com/latest.md) · [Categories](https://forum.deltamotion.com/categories.md) · [Tags](https://forum.deltamotion.com/tags.md)

**Page:** 2

---

## [Starting User Programs by writing to a variable](https://forum.deltamotion.com/t/starting-user-programs-by-writing-to-a-variable/119)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [January 26, 2011, 5:18pm UTC](https://forum.deltamotion.com/t/starting-user-programs-by-writing-to-a-variable/119 "2011-01-26T17:18:01Z")

</div>

The simplest method of starting a program is to write to a variable. This is useful for communicating with the RMC from a PLC. Once it is set up, the PLC simply needs to write to a value to a variable in the RMC to start…

---

## [Run a user program continuously](https://forum.deltamotion.com/t/run-a-user-program-continuously/160)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [December 1, 2011, 6:08pm UTC](https://forum.deltamotion.com/t/run-a-user-program-continuously/160 "2011-12-01T18:08:29Z")

</div>

This topic explains the steps to take to make sure a user program will always run. Make the User Program Loop Use a Link Type that jumps back to the step where you want the loop to begin. If the program has only one …

---

## [Copy data from Excel to Variable Table](https://forum.deltamotion.com/t/copy-data-from-excel-to-variable-table/439)

<div class="topic-metadata">

**Author:** [@Paul\_Huumala](https://forum.deltamotion.com/u/Paul_Huumala)\
**Replies:** 0\
**Last updated:** [February 1, 2018, 12:58am UTC](https://forum.deltamotion.com/t/copy-data-from-excel-to-variable-table/439 "2018-02-01T00:58:03Z")

</div>

This example shows how to paste variable table information from an excel spreadsheet into the variable table in RMCTools. DWORDS and arrays (ex. REAL\[5\]) make copying into the variable table somewhat difficult. Following…

---

## [System Time Functions](https://forum.deltamotion.com/t/system-time-functions/425)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [August 4, 2017, 11:18pm UTC](https://forum.deltamotion.com/t/system-time-functions/425 "2017-08-04T23:18:28Z")

</div>

System time in the RMC200 is stored as two DINT values, one representing seconds, and the other nanoseconds. This time format is also used by the Event Timer feature. The attached user functions can be used to capture s…

---

## [Make a user program always run](https://forum.deltamotion.com/t/make-a-user-program-always-run/436)

<div class="topic-metadata">

**Author:** [@Paul\_Huumala](https://forum.deltamotion.com/u/Paul_Huumala)\
**Replies:** 0\
**Last updated:** [December 20, 2017, 10:56pm UTC](https://forum.deltamotion.com/t/make-a-user-program-always-run/436 "2017-12-20T22:56:57Z")

</div>

A user program can be made to always run when in RUN mode. The RMC can be set to startup in RUN mode, so the user program runs at startup. To make a user program always run: Dedicate a task for this user program a. D…

---

## [Ramp to new gain values over time](https://forum.deltamotion.com/t/ramp-to-new-gain-values-over-time/563)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [April 16, 2019, 11:07pm UTC](https://forum.deltamotion.com/t/ramp-to-new-gain-values-over-time/563 "2019-04-16T23:07:15Z")

</div>

When an axis is moving, such as running a sine wave, abruptly changing the gains during tuning can cause a jerk in the motion. Attached is a user program that linearly ramps the gains to new values over a user-selected t…

---

## [Bit Test User Function](https://forum.deltamotion.com/t/bit-test-user-function/740)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [May 1, 2020, 10:13pm UTC](https://forum.deltamotion.com/t/bit-test-user-function/740 "2020-05-01T22:13:01Z")

</div>

This user function checks a bit in a DWORD. BitTest.rmcflib (520 Bytes)

---

## [Figure 8 Using Curves](https://forum.deltamotion.com/t/figure-8-using-curves/97)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [August 30, 2010, 9:22pm UTC](https://forum.deltamotion.com/t/figure-8-using-curves/97 "2010-08-30T21:22:46Z")

</div>

This project illustrates how to: Create curves from a user program. How to make two-dimensional circular motion with curves. The example actually makes a figure 8. Figure8UsingCurves.rmcproj (47.5 KB)

---

## [Sequencing Commands in the Variable Table](https://forum.deltamotion.com/t/sequencing-commands-in-the-variable-table/98)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [August 30, 2010, 9:26pm UTC](https://forum.deltamotion.com/t/sequencing-commands-in-the-variable-table/98 "2010-08-30T21:26:47Z")

</div>

As shown in the attached user program, if the user needs to be able to make their own motion sequence at any time, you can do it by giving them a limited number of commands, have the HMI write it to an array in the Varia…

---

## [Degree-based Trig Functions](https://forum.deltamotion.com/t/degree-based-trig-functions/170)

<div class="topic-metadata">

**Author:** [@qtormanen](https://forum.deltamotion.com/u/qtormanen)\
**Replies:** 0\
**Last updated:** [May 10, 2012, 6:56pm UTC](https://forum.deltamotion.com/t/degree-based-trig-functions/170 "2012-05-10T18:56:07Z")

</div>

The standard trignometric functions (SIN, COS, TAN, SIN, ACOS, ATAN) provided in the RMC controllers handle angles in radians. The attached User Function library provides SIN\_DEG, COS\_DEG, and TAN\_DEG, which accept an an…

---

## [Feedback Linearization](https://forum.deltamotion.com/t/feedback-linearization/204)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [March 15, 2013, 9:19pm UTC](https://forum.deltamotion.com/t/feedback-linearization/204 "2013-03-15T21:19:39Z")

</div>

Feedback linearization refers to either “straightening” the output of a transducer to make up for its nonlinearity, or calculating the measurement of some point that is geometrically related to the transducer measurement…

---

## [Switching Feedback on the Fly](https://forum.deltamotion.com/t/switching-feedback-on-the-fly/206)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [March 15, 2013, 9:58pm UTC](https://forum.deltamotion.com/t/switching-feedback-on-the-fly/206 "2013-03-15T21:58:59Z")

</div>

Switching feedback on-the-fly can be implemented in the RMC by using Custom Feedback. Attached is an example project that demonstrates this. This involves creating a user program that assigns the value of the selected p…

---

## [Keeping track of curve or sine cycles even with interruption](https://forum.deltamotion.com/t/keeping-track-of-curve-or-sine-cycles-even-with-interruption/213)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [June 6, 2013, 8:00pm UTC](https://forum.deltamotion.com/t/keeping-track-of-curve-or-sine-cycles-even-with-interruption/213 "2013-06-06T20:00:59Z")

</div>

When performing tests that entail a large number of cycles of a curve or a sine wave, it becomes important to be able to resume the test at the correct cycle count if the test is aborted for some reason. Attached is an …

---

## [Crv\_interp\_x](https://forum.deltamotion.com/t/crv-interp-x/327)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [July 31, 2014, 4:35pm UTC](https://forum.deltamotion.com/t/crv-interp-x/327 "2014-07-31T16:35:43Z")

</div>

The RMC70 and RMC150 have a built-in CRV\_INTERP\_Y function, but no CRV\_INTERP\_X function. Attached is a CRV\_INTERP\_X user function. It should only be used for monotonically increasing curves. To add the function to your…

---

## [Interpolation Functions](https://forum.deltamotion.com/t/interpolation-functions/457)

<div class="topic-metadata">

**Author:** [@Paul\_Huumala](https://forum.deltamotion.com/u/Paul_Huumala)\
**Replies:** 0\
**Last updated:** [March 12, 2018, 9:37pm UTC](https://forum.deltamotion.com/t/interpolation-functions/457 "2018-03-12T21:37:23Z")

</div>

The RMC75, RMC150 and RMC200 support custom user functions. The attached functions are for linear, quadratic, cubic and quartic interpolation. The accuracy of these functions is limited due to 32-bit floating point math …

---

## [Upload plots from excel back to back](https://forum.deltamotion.com/t/upload-plots-from-excel-back-to-back/460)

<div class="topic-metadata">

**Author:** [@Paul\_Huumala](https://forum.deltamotion.com/u/Paul_Huumala)\
**Replies:** 0\
**Last updated:** [May 15, 2018, 4:23pm UTC](https://forum.deltamotion.com/t/upload-plots-from-excel-back-to-back/460 "2018-05-15T16:23:19Z")

</div>

This example is for continuously uploading consecutive plots from Excel using RMCLink. RMCLink itself includes an example that uploads plots, but that example requires a sufficient delay between plots to upload them. The…

---

## [Random Number Generator](https://forum.deltamotion.com/t/random-number-generator/360)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 0\
**Last updated:** [June 22, 2015, 6:30pm UTC](https://forum.deltamotion.com/t/random-number-generator/360 "2015-06-22T18:30:53Z")

</div>

Attached is a user function that generates a random REAL number between 0 and 1. The attached user program demonstrates how to use it. Import both of these into an RMCTools project. CalcRandomNumber.rmcprog (1.09 KB) R…

---

## [Optimizing User Programs and Tasks](https://forum.deltamotion.com/t/optimizing-user-programs-and-tasks/731)

<div class="topic-metadata">

**Author:** [@Peter\_Nachtwey](https://forum.deltamotion.com/u/Peter_Nachtwey)\
**Replies:** 0\
**Last updated:** [April 21, 2020, 4:52pm UTC](https://forum.deltamotion.com/t/optimizing-user-programs-and-tasks/731 "2020-04-21T16:52:10Z")

</div>

Sometimes the application requires high frequency motion. To achieve this the control loop should be set as low as possible. The consequences of this are that the amount of time for user programs is reduced. This vi…

---

## [Program Trigger on DINT Bit](https://forum.deltamotion.com/t/program-trigger-on-dint-bit/684)

<div class="topic-metadata">

**Author:** [@TimRyder](https://forum.deltamotion.com/u/TimRyder)\
**Replies:** 3\
**Last updated:** [December 30, 2019, 7:40pm UTC](https://forum.deltamotion.com/t/program-trigger-on-dint-bit/684 "2019-12-30T19:40:58Z")

</div>

I’d like to trigger a program or several programs to run based on a DINT bit value. If a specific bit within the DINT is true, execute program A, bit 2 execute program B. Can this be done? If so how? I can’t seem to mak…

---

## [Copy Retained Variables' Current Values to Initial Values](https://forum.deltamotion.com/t/copy-retained-variables-current-values-to-initial-values/465)

<div class="topic-metadata">

**Author:** [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Replies:** 1\
**Last updated:** [August 11, 2018, 1:10am UTC](https://forum.deltamotion.com/t/copy-retained-variables-current-values-to-initial-values/465 "2018-08-11T01:10:07Z")

</div>

The attached project contains user programs for copying the current values to the initial value for all retentive (Retained) variables. CopyRetainedVarsToInitialValue.rmcproj (310 KB)

[Previous page](https://forum.deltamotion.com/c/knowledge-base-examples/programming/32.md)
