Search talk: IF OR THEN

 
<< < 1 2 3 4 5 .. 42 > >> (Page 3 of 42)

How to determine, if there is no active Alarm? CODESYS Forge talk (Thread)
How to determine, if there is no active Alarm?
Last updated: 2020-05-13

Unerwartetes End-of-file in If-Bedingung CODESYS Forge talk (Thread)
Unerwartetes End-of-file in If-Bedingung
Last updated: 2009-08-18

Error result in simple ST 'IF Else' result CODESYS Forge talk (Thread)
Error result in simple ST 'IF Else' result
Last updated: 2021-08-01

Create Folder in Codesys only if does not exist CODESYS Forge talk (Thread)
Create Folder in Codesys only if does not exist
Last updated: 2021-10-06

How to check if library produces compile errors CODESYS Forge talk (Thread)
How to check if library produces compile errors
Last updated: 2017-02-10

Detect if Dialog in Webvisu is opened? CODESYS Forge talk (Thread)
Detect if Dialog in Webvisu is opened?
Last updated: 2020-06-09

Boolean function as a IF condition CODESYS CODESYS Forge talk (Thread)
Boolean function as a IF condition CODESYS
Last updated: 2023-05-05

Check if Codesys runtime is on 'Running' or 'Stopped' state? CODESYS Forge talk (Thread)
Check if Codesys runtime is on 'Running' or 'Stopped' state?
Last updated: 2024-07-02

ModbusServer became unreachable if reach maximum of 16 byClientConnections CODESYS Forge talk (Thread)
ModbusServer became unreachable if reach maximum of 16 byClientConnections
Last updated: 2024-08-27

When Keyboard Key is in Hold, then Webvisu is extreme slow and latent CODESYS Forge talk (Thread)
When Keyboard Key is in Hold, then Webvisu is extreme slow and latent
Last updated: 2023-09-20

When Keyboard Key is in Hold, then Webvisu is extreme slow and latent CODESYS Forge talk (Thread)
When Keyboard Key is in Hold, then Webvisu is extreme slow and latent
Last updated: 2023-01-17

Codesys OPC DA server requires more then 2 GB of ram CODESYS Forge talk (Thread)
Codesys OPC DA server requires more then 2 GB of ram
Last updated: 2024-01-25

Start Codesys project and then execute python script from command line CODESYS Forge talk (Thread)
Start Codesys project and then execute python script from command line
Last updated: 2024-09-30

Post by eschwellinger on Can't use new licensing with Raspberry Pi CODESYS Forge talk (Post)
please delete the contents of the following directory - /var/opt/codesys/.cmact_license/ then start a new SPS and then the activation should work (then you have a new empty UFC SoftContainer)
Last updated: 2024-04-22

Post by open on How to create a stopwatch? CODESYS Forge talk (Post)
Hi @ph0010421, I tried the program the TimeTaken is calculated when stop is triggered. I want the TimeTaken to be continuously calculated and counting when a BOOL variable is true. I tried to program this way: Declaration: PROGRAM PLC_PRG VAR bStartStop: BOOL := FALSE; // Start/Stop button bReset: BOOL := FALSE; // Reset button bRunning: BOOL := FALSE; // Flag indicating whether the stopwatch is running tStartTime: TIME; // Variable to store the start time tElapsedTime: TIME; // Variable to store the elapsed time END_VAR Implementation: // Main program logic IF bReset THEN // Reset button pressed, reset the stopwatch bRunning := FALSE; tElapsedTime := T#0s; ELSIF bStartStop THEN // Start/Stop button pressed, toggle the running state IF bRunning THEN // Stop the stopwatch bRunning := FALSE; ELSE // Start the stopwatch bRunning := TRUE; tStartTime := tElapsedTime; END_IF; END_IF // Update the elapsed time when the stopwatch is running IF bRunning THEN tElapsedTime := tElapsedTime + T#1s; // Adjust the time increment as needed END_IF However counting of the seconds is not accurate. I tried changing the main task cycle time interval to 1000ms. The counting of seconds become slower. (see attached) Please help
Last updated: 2023-12-08

Post by ph0010421 on How to create a stopwatch? CODESYS Forge talk (Post)
Do you need an 'hours-run' counter? And 1 second resolution is ok? I think you're over-thinking it. (The task time needs to be < 1second) Have a look at the LAD... Then, the time in seconds can be made into hh:mm:ss with this FUNction Declarations: FUNCTION funSecondsToStringTime: string VAR_INPUT InSeconds: UDINT; END_VAR VAR AsString: STRING; Minutes: UDINT; Hours: UDINT; Seconds: UDINT; MinutesAsString: STRING(2); HoursAsString: STRING(2); SecondsAsString: STRING(2); END_VAR and the code: Hours := InSeconds / 60 / 60; //Derive hours Minutes := (InSeconds - (Hours * 60 * 60)) / 60; //Derive minutes Seconds := InSeconds - ((Hours * 60 * 60) + (Minutes * 60));//Derive seconds HoursAsString := UDINT_TO_STRING(Hours); MinutesAsString := UDINT_TO_STRING(Minutes); SecondsAsString := UDINT_TO_STRING(Seconds); IF LEN(HoursAsString) = 1 THEN HoursAsString := CONCAT('0',HoursAsString); END_IF; IF LEN(MinutesAsString) = 1 THEN MinutesAsString := CONCAT('0',MinutesAsString); END_IF; IF LEN(SecondsAsString) = 1 THEN SecondsAsString := CONCAT('0',SecondsAsString); END_IF; AsString := CONCAT(HoursAsString, ':'); //assemble string AsString := CONCAT(AsString,MinutesAsString); AsString := CONCAT(AsString,':'); AsString := CONCAT(AsString, SecondsAsString); funSecondsToStringTime := AsString;
Last updated: 2023-12-08

Post by ragarcia on Error while using UpdateConfiguredIPSettings to change IP address CODESYS Forge talk (Post)
Hello everyone, I am trying to change dynamically by code the IP address of a Weidmuller controller. So I am basically using IoDrvEthernet library to use UpdateConfiguredIPSettings function but I am getting constantly the 'INVALID_STATE' error. Even though I am following a procedure it should work: * First I added on the config file of codesys the following: [SysSocket] Adapter.0.Name="eth0" Adapter.0.EnableSetIpAndMask=1 Adapter.1.Name="eth1" Adapter.1.EnableSetIpAndMask=1 * Secondly I am first disabling the ethernet interface by using Ethernet_0.Enable = FALSE and then executing DED.Reconfigure. After that, I run the Ethernet_1.updateConfiguredIPSettings Code: Ethernet_1.Enable:= EnableDisable; Reconfigure(xExecute:= TRUE, itfNode:= Ethernet_1, xError=> ErrorReconfigure, eError=> ErrorCodeReconfigure); IF Reconfigure.xDone THEN ErrorCodeIP:= Ethernet_1.UpdateConfiguredIPSettings(IPAddress:= newIP, SubnetMask:= newMask, Gateway:= newGW); END_IF IF Reconfigure.xDone OR Reconfigure.xError THEN Reconfigure(xExecute:= FALSE); END_IF Ethernet_1.Enable:= TRUE; Reconfigure(xExecute:= TRUE, itfNode:= Ethernet_1); IF Reconfigure.xDone OR Reconfigure.xError THEN Reconfigure(xExecute:= FALSE); END_IF Can someone help me? Thank you. All I am trying is to find a way to change dynamically with code, the IP addresses of my controller (2 ethernet ports).
Last updated: 2023-12-11

Post by caprez95 on Deleting the trend recording history CODESYS Forge talk (Post)
Hallo Ich möchte eine laufende Trendaufzeichnung stoppen, den Inhalt löschen und Trend-Diagramm auf 0 zurücksetzen. Laut Codesys soll das mit dem folgenden Code möglich sein: You can insert an input element in the visualization which the operator can use to delete the previous value recording in the trend visualization at runtime. The curve displayed until then is removed and the display starts over. In the application (example: in the program PLC_PRG), implement the following code: itfTrendRecording : ITrendRecording; itfTrendStorageWriter : ITrendStorageWriter; itfTrendStorageWriter3 : ITrendStorageWriter3; sTrendRecordingName : STRING := 'TrendRecording'; itfTrendRecording := GlobalInstances.g_TrendRecordingManager.FindTrendRecording(ADR(sTrendRecordingName)); xClearHistoryTrend: BOOL; IF xClearHistoryTrend THEN itfTrendRecording := GlobalInstances.g_TrendRecordingManager.FindTrendRecording(ADR(sTrendRecordingName)); IF itfTrendRecording <> 0 THEN itfTrendStorageWriter := itfTrendRecording.GetTrendStorageWriter(); IF __QUERYINTERFACE(itfTrendStorageWriter, itfTrendStorageWriter3) THEN itfTrendStorageWriter3.ClearHistory(); END_IF END_IF In the visualization of the trend recording, add a button for deleting the previous curve. Configure its Toggle property with the variable PLC_PRG.xClearHistoryTrend. ⇒ When xClearHistoryTrend is set to TRUE, the previously recorded curve is deleted. The recording immediately starts again. Dies löscht auch die Daten vom Trend, aber das Diagramm wird nicht auf 0 zurückgesetzt, sondern läuft einfach da weiter wo man gestoppt hat. Braucht es für den Diagramm-Reset noch einen zusätzlichen Befehl? Gruss
Last updated: 2024-06-11

Post by timvh on License problem gateway CODESYS Forge talk (Post)
What we are trying to explain is that, yes CODESYS creates the software, but Epis decides how they implement it on their hardware, which runtime version they use and they decide which functionality they support. So it is always a combination of the two. What CODESYS provides is a runtime with options for e.g. visualization or softmotion. Epis could add this softmotion license as default to their controller, but if they don't then CODESYS provides another option with a single license in a "Wibu CodeMeter" container. Eventhough the feature exists, Epis has to add this "CodeMeter" software on their controller to be able to access the licenses in the container. We don't know if they did this. Then finally it depends on what type of runtime is on this controller and which license Epis is using. So if they have an OEM license (not an application based license), then most likely you will need the Softmotion license (not a number of axis). See https://store.codesys.com/en/codesys-softmotion-sl-bundle.html. But to be sure if this is supported by the Epis controller, you must ask Epis.
Last updated: 2024-04-30

Post by eschwellinger on Persistence Manager Backup CODESYS Forge talk (Post)
you need at them moment a download once (for the configuration files generated including addresses) then stop the plc - exchange the persistence file ( without the config file) This will be improved to 3.5.18.6 and 3.5.20.0. (possible then to generate offline bootproject including full persistenmanager files) - this is if you have not 100% the same bootapplication on the devices. In case you copy the whole Application (PLCLogic) directory it should work out of the box - but only with 100% same bootprojects as mentioned above. By the CODESYS Automation Server would help solve this too.
Last updated: 2023-10-19

Post by ojz0r on INT_TO_WORD function not working CODESYS Forge talk (Post)
That calculation will not work the way you expect it to. If PumpFillSpeed is limitied to 0-50 then the only whole number would be 50/50 = 1 everything else is 0.0-0.9999... and since you are using word and integer only 50 would work since there is no representation for mantissa in integer values. Declare a temporary real variable and do the calculation and then do a REAL_TO_WORD in the DRV2Speed assignment.
Last updated: 2024-01-26

Post by wiresplus on Display minutes as hours & minutes CODESYS Forge talk (Post)
Hello, I have a counter that increments an INT value once per minute I want to display this value in Minutes until 60, then Hours/Minutes thereafter on the HMI Codesys V3.5 SP16 I can divide the minutes by 60 to get hours, but then the minutes is still more than 60. Example: a process has run for 350 Minutes. I need to display "5 Hours 50 Minutes" But if it's only been 45 Minutes, I don't want "0 Hours 45 Minutes" , just "45 Minutes"
Last updated: 2024-05-25

Post by timvh on Unable to Connect to Modbus RTU Device CODESYS Forge talk (Post)
If your Control Win is the Modbus "Master" then your configuration should be something like: Modbus_COM (Serial port) - Modbus Master (this is the Control Win SoftPLC actively setting up the communication) - Modbus Slave (this is then your WAGO 750-315) You need to add channels to the Modbus Slave configuration to inform the master which variables to read/write from the Wago module. The way you configured it now, the Control Win is also a slave. PS, don't forget to put the PLC (Control Win) in Run.
Last updated: 2024-09-03

Post by timvh on Codesys SVN CODESYS Forge talk (Post)
If you use 3.5 SP10, then Git is not supported. SVN will work fine, but with this version you do need a USB key, because software licenses are not supported with this version. Off course you can work without SVN (or Git), but especially if you work with multiple developers on one project, it will save you a lot of time and you can keep track of all changes and improvements much easier. So how much is this worth to you?
Last updated: 2024-04-30

Post by kris-samoy on Get Alarm status in Codesys CODESYS Forge talk (Post)
I am rather new to Codesys and I'm trying to figure out how to get the status of an alarm. This to interlock the start of a device until the alarm has been acknowledged... I am not sure if IAlarm.GetState (METH) can be used for this purpose. If yes then could someone please briefly explain how to use this? https://content.helpme-codesys.com/en/libs/AlarmManager/4.1.0.0/Interfaces/pou-IAlarm/GetState.html Thx & grtz, Kris
Last updated: 2024-06-03

<< < 1 2 3 4 5 .. 42 > >> (Page 3 of 42)

Showing results of 1028

Sort by relevance or date