Jump to content

Search the Community

Showing results for tags 'c functions'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Our Community
    • Come on in!
  • News and Announcements
    • UniLogic 2021-- UniCloud IIoT Cloud Platform, EtherCAT & more!
    • VisiLogic:9.8.64 - Link to mobile app, Ladder: 2x the Space!
    • New!!! ***** U90 Ladder*****
  • UniStream HMI + PLC Programmable Controllers & UniLogic Software
    • UniStream: Hardware
    • UniLogic Software
    • UniLogic UDFBs
    • Industry 4.0, IioT, MQTT, OPC UA
  • Vision, Samba, Jazz and M90 PLC + HMIs & Software
    • Vision & Samba PLC + HMI Controllers & VisiLogic Software
    • Jazz, M91 PLCs and U90Ladder
  • Motion! Servo Drives, Motors, Actuators, & VFDs by Unitronics
    • Motion: Unitronics Servo Drives, Motors, Actuators, VFDs--by Unitronics
  • UniCloud: the end-to-end IIoT Platform for Unitronics Controllers
    • Everything UniCloud!
  • Software Utilities
    • SD Card Suite
    • Remote Operator
    • Remote Access
    • DataXport and DataXls
    • UniDownloader
    • UniOPC
    • UniDDE
  • Utilities for .net and Visual Studio
    • Unitronics PCOM Protocol
    • COM Object ActiveX .dll
    • .NET driver
  • Project Design
    • ...I have a project...what hardware do I need?
  • User Application Stories
    • Just finished a great project?
  • Everything HMI!
    • UniLogic: HMI Design Inspiration
    • UniLogic: Graphics, from Community!
    • VisiLogic--HMI Design
  • Tips and Tricks
    • Best Programming Practices
    • Tips and Tricks
  • Job Board
    • Projects seeking Programmers
    • Programmers seeking Projects
  • General Discussion
    • We're Listening...
    • The Lounge
  • News and Announcements Copy


  • Unitronics' Blog: PLCs, HMIs and more
  • Saragani's Blog
  • Simon's Blog
  • Ash Neilson's Blog
  • Joe Tauser's Blog
  • Unitronics en Español
  • Powered by AMPS
  • Alldrives UK's Blog
  • Unitronics, Howman Style
  • PLCNewbie's Blog
  • Telestar Automation Blog
  • Webinars Collection
  • Tim's Corner
  • Blog
  • TELESTAR (Italian)
  • i4 Automation
  • i4 Automation (UK)
  • Unistream UDFB's


  • From Headquarters: Sample Applications
    • From Headquarters: VisiLogic
    • From Unitronics: U90 Ladder applications
  • User-submitted Applications
    • From Users: VisiLogic applications
    • From Users: U90 Applications


  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 15 results

  1. Hello all, I was asked to write some software for a machine using a Unitronics PLC, programming in Unilogic is new to me but I've got the machine up and running quite easily, the software is verry intuitive. However it does lack structured text programming... for the more complex tasks I was told I could write my own C functions. This does however bring some limitations with it, the worst one being not being able to acces the global tags and being limited to 256 bytes of data within the functions. Is there a way to call other functions within the C function? This would be a workaround for these limitation. For example: I need to loop through an array that has 100 items, and then perform a calculation on these items. The looping part would fit in a C function but the calculation combined with the array size would require more then 256 bytes. If I could call another function when looping through the for loop this would solve my problem.
  2. Hello, I'm wondering if my problem is a software one or hardware? And what kind of issues could be causing it in each case. The system is alright when at rest, but when put to work (triggered with input) it works fine for maybe 10-20 seconds and then I get a "CPU in stop mode" message on the screen" and few second later a message about CPU error. I've removed the CPU unit and put it back on, but with no luck. Does anyone have some hint for me? Thanks, Bjarni
  3. Hi, I have been looking into the c function programming of Unilogic. Can I address global tags of the solution inside the c function? If yes, is there a way to get for example System: "RTC time.Seconds" and other tags that might include 'space' char?
  4. Hi. How can i change a data table fields using c function? Can you please send me an example?
  5. Is there way to convert STRING-ASCII to STRING-UTF16. I have data table with UTF-16 column for messages, but in one case I want to add number there, but number is in ASCII. Maybe someone knows some existing method for this kind of conversion ? I can probably create this function, but is UniLogic internally "Little endian" or "Big endian" ? Anatoly
  6. I have some simple C functions, but suddenly I noticed all code is gone and functions are displayed as empty. I was worried, did I accidentally delete some of it, but luckily I have older versions so I opened these and copied content into notepad. But when I reopened newer file (file where c functions were empty) all content was back. I even saved newer file before opening older file. So conclusion - C functions window displayed functions as empty, even when content actually did exists there.
  7. I have two identical functions, except "Function In" has different array lengths. Inside function I can easily determine array length with "Array Size", but understandably "Function In" doesn't accept different array lengths. Is it possible declare "Function In" so it will accept different length of arrays ?? I figured if I declare short arrays they will accepts calls with longer arrays. Question, Is entire array accessible from function or only smaller subset ?
  8. Trying to create C function to convert a String ASCII to upper case. This is what I tried and it does not work: static void PrefixToUpper(volatile char* Prefix, int PrefixLen) { // User code starts below this comment for (int i = 0; Prefix[i] != '\0' ; i++) { if(Prefix[i] >= 'a' && Prefix[i] <= 'z') { Prefix[i] = Prefix[i] - 32; } } // User code ends above this comment } // User code starts below this comment Tested the code in C compiler and it runs correctly: static void PrefixToUpper(volatile char* Prefix) { // User code starts below this comment for (int i = 0; Prefix != '\0' ; i++) { if(Prefix >= 'a' && Prefix <= 'z') { Prefix = Prefix - 32; } } // User code ends above this comment } int main() { char str[] = "hmh00234"; printf("String input: %s\n", str); PrefixToUpper(str); printf("String output: %s\n", str); }
  9. Hello, I've been trying to load a string from a c-function - without luck. Made few approaches though. One example here: -------------------------------------------------- char arr[3][32] = { "String 1", "String 2", "String 3" }; // User code ends above this comment static void getString(unsigned short Index, volatile char* TheString, int TheStringLen) { // User code starts below this comment TheString =arr[Index]; // User code ends above this comment } ----------------------------------------------------- TheString defined as here: Is there a way to do it? Thanks, Bjarni
  10. I'm trying to use a for loop to go through each index of an array and get averages for the total array. I need to do with on 8 arrays so I need to also use a global array to store the averaged values. How do i use global variables in C functions or declare them in C Functions?
  11. Why can not I change the arguments of function C. When I put the cursor on the line with the name of the function, do not enter any characters from the keyboard?
  12. Is it possible to write complete control code in C? if so' how do I define inputs\outputs in my code and how to I use the software Timers?
  13. Hi everyone! I'm writing a C Function in UniLogic. I would like to use a local variable, bigger than 4 bytes, like a long long int. Is it possible? Because I have no compilations errors, but I think it doesn't work. Thanks in advance.
  14. Code like this fail to compile, with the errors in the image below. The error lines are wrong (which I'll report to unitronics in a bit), but the code compiles without the lines I showed. static void Function3() { // User code starts below this comment float a = 50; float b = 3; if(IF_EQ(1, a, 4)) STORE(1, 4, b); // User code ends above this comment } Am I using IF_EQ wrong? The docs say that IF_EQ(1,a,b) is equivalent to a == b, so I assume that this is the correct syntax.
  15. I am trying to create a C Function and am running into many questions which the help does not cover. I loaded and examined all of the examples available on the website. The first question I have is: how do I specify what the arguments are going to be for my C Function? The examples have arguments. I cannot alter the arguments in the examples, nor can I add arguments to my attempted C Function. UniLogic Studio 1.23.25.
  • Create New...