How to use Assembly in B&R PLC
B&R PLC could be programmed with C and C++. But you can also use Assembly. Below short instruction how to do that.
B&R PLC could be programmed with C and C++. But you can also use Assembly. Below short instruction how to do that.
B&R PLC could be programmed with C++. State Machine is common used pattern. There are lot of examples of how to implement State Machines in C++. One of the example was taken and turned to B&R State Machine
It is a very funny fact that the NI’S Web Site doesn’t support NI’s Snippets properly, especially on NI Forum, where the Snippets used actively to exchange the small pieces of the LabVIEW code. Here how you can get code from such snippets.
In some cases we need to measure a very short intervals (hundreds of the CPU Tacts) directly in Assembler. We can perform measurement by using cpuid/rdtsc combination.
Collection of useful small Snippets
A very simple and basic TCP communication example for Python and LabVIEW
Interesting question was raised on NI Forum. “I have created an app that works without issue… As a DLL called by Python, 1 of the functions work… the other just freezes.”. The reason is — the Execution System was set “same as caller” (which is default), but Python is not LabVIEW.
In this “weekend” experiment I’ll write large file (16 GB in my case), then read it back with different buffer size and threads and check the performance.
Nowadays development on pure Assembler is not very popular, because modern compilers can generate “good” code. On the other hand this is a very good exercise, which helps to understand a calling conventions and how it work in very low details.
When calling external code in LabVIEW, we need very often to pass arrays into external DLL. This small “step by step” tutorial walks you through two possible ways of calling C/C++ DLLs manipulating LabVIEW arrays inside.
Calling external code from different languages is great feature of LabVIEW. In general you can wrap almost anything into DLL, then call it by Call Library Function Node. This time we will mix Rust code with LabVIEW.
This is a question, raised again and again on the forums about third-party DLLs: “…whatever I do I cannot get the library to work in LabVIEW. I get the error “The library for this node cannot be found or cannot be loaded….”. Below short “check list” with some explanations.
Some useful variables like %PROGRAMFILES% or %USERPROFILE%, which I often forgot.
Two ways, how to check if a binary is 32 or 64 bit on Windows. One is “official”, using dumbpin and another one is “funny” using … Notepad.
Every LabVIEW’s control part contains a “part ID” field which determines its purpose and functionality in the control. For example, a digital numeric control contains two BigMultiCosmetic parts for the increment and decrement buttons; the part ID is what determines which one is which. The Parts Window in the control editor displays the part ID as the textual name for the part, though the actual number is only visible in Heap Peek.