Two questions:

1. What function will output N bytes of data? The data may contain and may end with numeric zero.
2. What function will cause the process to suspend for N milliseconds?

An explanation for question 1.

struct modbus_structure {
            char device_address;
            char function_code;
            UINT function_address;
            UINT address;
            UINT checksum;
      };
 
struct modbus_structure send_buffer
...
status = some_fput_function( send_buffer, 8, Port_Handle );

As I imagine it, some_fput_function takes 3 arguments, the data, the number of bytes to output, and the handle to use to output the data. Is there a function that will effectively do this?

Late edit, BTW, this is C only, compiled under the LCC compiler. No windows or GUI code.

Thanks for your time,
bkelly

you could use fwrite() assuming Port_Handle is the handle to an open file. -- see C docs for description of that function.

With regard to question #2, that would be implementation specific. If you are not on a hosted system, I would imagine that you can at least name the platform, which may have its own specifics (and manuals) to query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.