Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

FuzzyOpen

  • Last UpdatedJul 18, 2023
  • 1 minute read

This function loads a *.FTR file, allocates memory and creates a handle for this fuzzy instance. To use the FuzzyTech functions you need to be a registered user of one or more of the following fuzzyTech products: fuzzyTECH Online Edition, fuzzyTECH Precompiler Edition, or fuzzyTECH for Business PlusC. And you need to only use fuzzyTECH to generate the *.FTR file for FTRUN.

The application needs to call the FuzzyClose function to delete each fuzzy instance handle returned by the FuzzyOpen function.

Syntax

FuzzyOpen(sFile)

sFile:

Specifies the filename of the .FTR file to load.

Return Value

The handle to the fuzzy instance, or -1 if the function cannot complete the operation. Use IsError to find the error number.

FuzzyClose, FuzzyGetShellValue, FuzzySetShellValue, FuzzyGetCodeValue, FuzzySetCodeValue, FuzzyTrace.

Example

INT hFuzzy;

INT NoHitFlag;

INT Status;

REAL MemOutput;

// open the Fuzzy Tech runtime instance

hFuzzy = FuzzyOpen

("%PROGRAMFILES(X86)%\AVEVA Plant SCADA\Bin\traffic.ftr");

Status = IsError();

IF hFuzzy <> -1 THEN

MemOutput = PLCOutput;

WHILE Status = 0 DO

FuzzySetShellValue(hFuzzy, 0, 42.0);

FuzzySetShellValue(hFuzzy, 1, 3.14150);

MemOutput = FuzzyGetShellValue(hFuzzy, 2, NoHitFlag);

Status = IsError();

// Only write to PLC if output changes.

// This reduces load on PLC communication.

IF MemOutput <> PLCOutput THEN

PLCOutput = MemOutput;

END

SleepMS(500);

END

FuzzyClose(hFuzzy);

END

See Also

Fuzzy Logic Functions

In This Topic
TitleResults for “How to create a CRG?”Also Available in