Jump to content

Recommended Posts

Posted
Hi. i'm a beginner with Cicode Scada. i'm trying to send some (non-protocol) data via Com1 on my PC to a Device . i wrote a code in Cicode to open a Port i define in Port database named Port1_Bord1 but every time i run my project all ports automatically will be opened and ComOpen function always return -1 value; FUNCTION OpenPort() INT hPort; STRING sPort; STRING Send; sPort = "PORT1_BOARD1" hPort = ComOpen (sPort,1); mmes = hPort; IF hPort >= 0 THEN Send = "somedata"; SendLength = StrLength(Send); ComWrite(hPort,Send,SendLength,2); ELSE Prompt("Not Open"); Message ("Info","Port NOT Opend.", 0); END END I will appreciate your helps.
Posted
A few things to check. For an onboard com port1 your Boards and ports form should look similar to the attached screen shot. Ensure there are no IO/Devices using this Port. Also the port can only be opened once. If the port is open and you try to re-open it it will return -1.
Posted
Hi chelton. i checked the Board and Port data. they are almost the same as you said. but when i run my project all ports are open with out any command. do you know what should i do?
Posted
no i create a new single project. there is no any other program or software using this port. i remove all IO devices but ports will be open when i run the project.
Posted
I would suggest you contact Citect global support with your issue, provided the product is in support. You can zip the project and send it to them. ww.citect.com

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...