菜单
  

    4, such as the be over string go communication, the close beats to rise of communication port.
    For example, control Leica with the calculator when the Tc2002 whole station instrument auto measure writing the following code can nicely carry out two of communication:
    The MS CommlCOmmPort=1'the constitution string go a communication
    The MS CommlSettings=''2400, e.7, IP1'constitution wave especially rate, strange accidentally check a school, data number and stop number
    The MS Comml InputLen=1'constitution or return to receive to use Input inside the buffer area an attribute to read the person's character list piece
    The MS Comml InbufferSize =4096'establish Buffer area size
    The MS CommlPortOpen=True'open a communication port
    Attention:1, be the string that the procedure would automatically close to open while terminating line.2, if receiving buffer area is more big, the effective memory of procedure usage more small, whereas probably receive buffer area spillage, therefore should pass an experiment to enlarge its size gradually. According to the constitution like this, get up a calculator, the whole station instrument conjunction with an electric cable, can carry out the string of calculator and whole station instruments line communication.
    Two, make use of the function of Windows API
    Under the some condition, MSComm, control a piece isn't suitable for our requests. We can use Windows at this time API provides of communication function to carry out can transplant sex strong string of line of communication procedure with writing. Windows 98 correspondence the system provided the string of an improvement line application the procedure pick up a people API to use to carry on handing over type string with each other line correspondence. Among them, string the and other correspond by letter an equipments is a document to carry on the processed, open, close, reading of string and write in the function used similar to the function of the operation document.
    Before adjusting to use APIA function, have to the first essentials pronouncement change to measure and function.
    Dim dcb As DCB
    Dim ofstructl As OFSTRUCT
    Dim operport As Long
    Open an API text to originally look into a machine in the V B wreath territory bottom, open Win32. Txt document, at"pronouncement"ing can the options win election in OpenFilc and Setup Cornm, Setup CommState and ReadFile, WriteFile, CIoscHand, le etc. function, in "type" can the options win election in DCB, OVERLAPPED etc. structure, in "constant" can the options win election in ODDPARITY, EVRXCHAR etc. often quantity, then choose a "replication", make duplicate them to the scrapbook, and glue to stick application procedure code in. Adjust to carry on a string of line communication with API in the VB 6.0 timeses:
    1,adjust to use CreateFile line communication first carry on a beginning to start to turn to the string. CreateFile function for read an interview or write an interview to beat
    Open a string of, return to that string of sentence handle after opening successfully, then adjust to use SetComm function is in a string of line allotment buffer area size, provide to read and write a string of usage, immediately after use DCB the structure change to measure a constitution to need to change the communication parameter of lacking the string line of saving the value, such as wave especially rate, strange accidentally the school check a , data, stop.
    2,adjust to use Write File, the Read File function carries on reading and writing an operation to the string line. Carry on a data to send out with Write File, for synchronous I/O operation, its last parameter can be NULL, but tread an I/O operation to the difference, its last parameter musts be a direction OVERLAPPED structure of point needle, make reading and writing of data the operation carry on in the backstage and pass this OVERLAPPED'structure to acquire current operation appearance. Use Read File receive buffer area to read from the string data, data before reading, use Clear Comm Error the function acquire word stanza within buffer area number.
  1. 上一篇:网上电影票预订英文文献和中文翻译
  2. 下一篇:Linux网络时间协议英文文献和中文翻译
  1. 汽车乘员舱的声振耦合英文文献和中文翻译

  2. 立体光照成型的注塑模具...

  3. 数控机床英文文献和中文翻译

  4. 工业机械手英文文献和中文翻译

  5. 低频振动的铁路车轴的状...

  6. 接头的形状对沥青塞接头...

  7. 数控加工技术英文文献和中文翻译

  8. java+mysql车辆管理系统的设计+源代码

  9. 大众媒体对公共政策制定的影响

  10. 杂拟谷盗体内共生菌沃尔...

  11. 酸性水汽提装置总汽提塔设计+CAD图纸

  12. 河岸冲刷和泥沙淤积的监测国内外研究现状

  13. 乳业同业并购式全产业链...

  14. 十二层带中心支撑钢结构...

  15. 当代大学生慈善意识研究+文献综述

  16. 电站锅炉暖风器设计任务书

  17. 中考体育项目与体育教学合理结合的研究

  

About

751论文网手机版...

主页:http://www.751com.cn

关闭返回