Home AMX User Forum AMX General Discussion

Raise Custom Event - Error 0xF075

Hello

(Sorry my English is a little bad)

I am a beginner in NetLinx and found in the File NetLinx.axi the method:
DEFINE_LIBRARY_FUNCTION DO_CUSTOM_EVENT(CONSTANT DEV A, CONSTANT TCUSTOM B)
But how i can use this function? The function is not documented.

I try follow coding:
DEFINE_DEVICE

dvSystem = 00000:001:000 // Master NI 700
dvPanel = 10001:001:000 // Touchpanel

DEFINE_VARIABLE

TCustom CustEvent

DEFINE_EVENT

data_event[dvPanel]
{
  online:
  {	
    send_string 0,"'Touchpanel online ...'"

    // It works
    send_command  dvPanel, "'?TXT-1,0'"
		
    send_string 0, ("'Prepare do_custom_event ...'")
		
    CustEvent.Device = dvPanel
    CustEvent.ID = 1         // Address
    CustEvent.Type = 1001    // EventId
    CustEvent.Flag = 0       // 0 means text is a standard string, 1 means Unicode encoded string
    CustEvent.Text = 'Test'
    CustEvent.Value1 = 1
    CustEvent.Value2 = 4
    CustEvent.Value3 = 1
    // cust.SourceDev = dvSystem
		
    send_string 0, ("'Start of Execute do_custom_event ...'")
		
    // CIpLibrary::CallFunction - Error 0xF075 
    do_custom_event(dvSystem, CustEvent) // or dvPanel
		
    send_string 0, ("'End of Execute do_custom_event ...'")
    }
}

custom_event[dvPanel, 1, 1001]
{
  Send_String 0,"'ButtonGet Id=',ITOA(CUSTOM.ID),' Type=',ITOA(CUSTOM.TYPE)"
  Send_String 0,"'Flag =',ITOA(CUSTOM.FLAG)"
  Send_String 0,"'VALUE1 =',ITOA(CUSTOM.VALUE1)"
  Send_String 0,"'VALUE2 =',ITOA(CUSTOM.VALUE2)"
  Send_String 0,"'VALUE3 =',ITOA(CUSTOM.VALUE3)"
  Send_String 0,"'TEXT =',CUSTOM.TEXT"
  Send_String 0,"'TEXT LENGTH =',ITOA(LENGTH_STRING(CUSTOM.TEXT))"
  send_string 0,"'Device = ', DevToStr(Custom.Device)"
  send_string 0,"'SourceDev = ', DevToStr(Custom.SourceDev)"
}

Now I execute the code and receive the following error: CIpLibrary::CallFunction - Error 0xF075

Why that or what can I do?

Comments

  • viningvining Posts: 4,368
    Where's your do_custom_event function? Also the function call should be using dvPanel not dvSystem since this custom event is to query button channel 1's text on a panel.

    And you also have the send command which works:
     send_command  dvPanel, "'?TXT-1,0'"
    
    but then populate a structure and call that function which I assume is doing the same as the send command above except ones going to the system and the other to the panel. If the send command works and you get a print out in diagnostics from your custom event handler's send_string 0's the error is likely because the function call is sending to dvSystem not dvPanel.
Sign In or Register to comment.