TwinCAT Programming

Manoj M

Member
Join Date
Feb 2014
Location
London
Posts
59
Hello Experts,
It may look very simple to all you experts but for me it is a big hurdle to cross. I have Twincat 2 and Vacon drives which are being controlled by program in TwinCAT. I got stuck where I am reading drive Active fault code. basically it is UINT and it varies from 1...71. Every single number has its own value.. e.g 1 is for over current, 2 is for overvoltage, 3 is for undervoltage and so on. I can read these numbers without any trouble but I have to transfer the relevant text to HMI telling the active fault in the system. I have created an array(1....71) of string but not able to link this array to DriveActiveFaultCode.
Any help in this matter will be highly appreciated.
Regards
 
Hello
There are several ways you could do this, I prefer Structured Text. One way to solve this is to use a CASE statement like in the example below.

siFaultCodeVFD is the active fault code and ysFaultCode is the string containing the description of the active fault code.

Code:
CASE siFaultCodeVFD OF
	1: ysFaultCode:='1: Overcurrent';
	2: ysFaultCode:='2: Overvoltage';
	3: ysFaultCode:='3: Ground(earth) fault';
	5: ysFaultCode:='5: Charging switch';
	6: ysFaultCode:='6: Emegency stop';
	7: ysFaultCode:='7: Saturation trip';
	8: ysFaultCode:='8: System Fault';
	9: ysFaultCode:='9: Under voltage';
        ---> 71
	
         103: ysFaultCode:='No Fault';
ELSE
	ysFaultCode:='Unknown fault code';
END_CASE
 
Hello All,
I have found another solution for this, because I think there is no as such option in TwinCAT alarm configurator or in alarm table to pull the array or string. In alarm configurator the only options I have are booleans. So this is what I did in the end.

Case INU_activefault code OF
1: b1:=true;
2: b2 := true;
and so on till I have enough bits for available faults in the drive.
Then I declared these bits in alarm configurator like this:
expression =b1 type DIG=1 Message= Inverter over current.
and defined every bit as per the drive manual fault codes.

Thanks to all of you who helped me in achieving this...

Regards
Manoj
 
Hello
Is it possible to use an array of bool in the alarm config?

FaultVFD[INU_activefault ]:= TRUE;

Another solution..
If you have a lot of drives your IO count will expand really quickly. I usually have one general alarm bit and one alarm string for each VFD. The general alarm will show up in the alarm list on screen, then the operator can go to the representation of the drive and read the string.
 
Hello Kimao
I have just one VFD and 50 odd alarms from the drive...
Further I cannot use array in alarm configurator because there is no as such option. I think (may be wrong) the limitation is because of expression tab in which I have to defined when I want this alarm to be appear in alarm table and the available options are DIG=1, DIG=0 LoLo, Lo, HiHi, Hi, DEV-, DEV+ and ROC (Rate of Change). So as you can see, I have to defined every alarm individually.

Regards
Manoj
 
Further to previous post my drives control keypads are inside the enclosure which I dont have any excess once the panel is closed. So i have to bring that alarm outside on HMI individually rather than generating only one alarm bit.

Regards
Manoj
 
Hello,
Vacon do offer a remote mounting kit to extend the display to a panel or door. Not a good solution in all applications but worth to mention..
 
I have the same kit connected via optical fiber with drive but it is still inside the enclosure.
Can't help it.

Regards
Manoj
 

Similar Topics

Hello everyone: I have been able to read and write data via canopen interface through ADS read and write functional blocks in Twincat PLC...
Replies
9
Views
4,296
Dear Members: I am new at Twincat PLC System. I am working on a project. I have connected CX9020 with a PSI-9750 high voltage power supply via...
Replies
2
Views
1,805
Hello everyone, Lately, I started working around with Beckhoff hardware (CX1010 CPU and a few I/O modules) and got pretty familiar with...
Replies
10
Views
4,532
Hello Experts I am trying for a program which increase/decrease value in steps of 1. If the push button is pressed there for less than 1 second...
Replies
5
Views
2,342
Hello Experts, I have simple query regarding defining memory bits in Global Variables. In my system I have two drives and CX2020 (Beckhoff). The...
Replies
5
Views
2,023
Back
Top Bottom