Skip to content
Start free evaluation

pdcomm_gem_formatted_program_submit

Function

Sends an S7F27 Process Program Verification Send to the host.

PdcommStatus pdcomm_gem_formatted_program_submit(PdcommTcpEndpoint *endpoint, const PdcommSecsItem *id, const PdcommGemFormattedProgramIssue *issues, size_t issue_count, PdcommTcpToken *out_token)

Declared in: #include <pdcomm_gem_formatted_programs.h>

Equipment only. The identifier and every issue, including its text, are validated against the configured limits and copied before S7F27 is queued. Success means the message was accepted for sending, not that the host replied: the S7F28 reply, a T3 timeout, or a disconnection is reported later through pdcomm_gem_handle_event() with the returned token.

Parameters

NameDescription
endpointEquipment endpoint in the GEM COMMUNICATING state.
idPPID: a nonempty ASCII or Binary item of at most 120 bytes.
issuesArray of issue_count issues. May be NULL when issue_count is 0, which sends an empty issue list.
issue_countNumber of issues; at most max_issues.
out_tokenReceives the transaction token. It is zeroed first whenever it is not NULL, so it is zero after every failure.

Returns

#PDCOMM_OK when S7F27 was queued; #PDCOMM_INVALID_ARGUMENT when a pointer is NULL, the PPID is not a nonempty ASCII or Binary item of at most 120 bytes, an issue code is above 5, an issue text is not ASCII, or an issue limit (max_issues, max_issue_text_bytes, max_total_issue_text_bytes) is exceeded; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment in the COMMUNICATING state or the service is not configured; #PDCOMM_BACKPRESSURE when a staged TCP event must be drained first, all 32 GEM request slots are in use, or the TCP send queue is full; #PDCOMM_LIMIT_EXCEEDED when max_pending reports are already waiting or the message exceeds the endpoint's SECS-II limits; other TCP statuses such as #PDCOMM_IO_ERROR when the message cannot be queued; #PDCOMM_POISONED when the endpoint is poisoned.

Notes

  • Ownership: id and issues stay owned by the caller.
  • Thread safety: serialize with every other call on endpoint.