|
Post by stan58 on Nov 22, 2018 16:32:06 GMT -5
Rod Top tip" print the command", all becomes clear
Thanks
|
|
|
Post by stan58 on Nov 22, 2018 18:12:48 GMT -5
Rod The tip to print the string was great,very clear
|
|
|
Post by darrintn on Sept 17, 2019 13:31:17 GMT -5
Well i am new, and i dloaded the LB495.zip and installed it on my windows 7 machine... and was just going to write a simple program to open the com port and send a character out the com port and close the com port. Keep getting Runtime Error:Incorrect Function? do not know what i am doing wrong have tried the examples you have at start of thread? Thanks for help in advance. Darrin
|
|
|
Post by tsh73 on Sept 17, 2019 14:41:58 GMT -5
|
|
|
Post by Carl Gundel on Sept 17, 2019 14:43:10 GMT -5
Well i am new, and i dloaded the LB495.zip and installed it on my windows 7 machine... and was just going to write a simple program to open the com port and send a character out the com port and close the com port. Keep getting Runtime Error:Incorrect Function? do not know what i am doing wrong have tried the examples you have at start of thread? Thanks for help in advance. Darrin Hi Darrin, You are trying to use a com port to communicate with a special device? Giving us more specific details will probably yield more successful help for you. First, make sure the example code is specified to use the particular com port that you have on your machine, assuming you have one. For example the code at the beginning of the thread is: open "com";(portn);":19200,n,8,1,ds0,cs0,rs" for random as #commwt In this case portn would need to be set to the port number of your machine. So if your port is 2 then perhaps this: portn = 2 open "com";portn;":19200,n,8,1,ds0,cs0,rs" for random as #commwt The parenthesis are not needed really so I removed them in my example. In addition to the com port number, the other parameters after (i.e. 19200, n, 8, etc.) also need to be appropriate for whatever serial device you are trying to communicate with.
|
|
|
Post by darrintn on Sept 17, 2019 14:53:36 GMT -5
oops my bad .... sorry i download the lb451setup ....... the other was the workshop ... my bad ... Darrin
|
|
|
Post by darrintn on Sept 17, 2019 14:56:33 GMT -5
Well i am new, and i dloaded the LB495.zip and installed it on my windows 7 machine... and was just going to write a simple program to open the com port and send a character out the com port and close the com port. Keep getting Runtime Error:Incorrect Function? do not know what i am doing wrong have tried the examples you have at start of thread? Thanks for help in advance. Darrin Hi Darrin, You are trying to use a com port to communicate with a special device? Giving us more specific details will probably yield more successful help for you. First, make sure the example code is specified to use the particular com port that you have on your machine, assuming you have one. For example the code at the beginning of the thread is: open "com";(portn);":19200,n,8,1,ds0,cs0,rs" for random as #commwt In this case portn would need to be set to the port number of your machine. So if your port is 2 then perhaps this: nport = 2 open "com";portn;":19200,n,8,1,ds0,cs0,rs" for random as #commwt The parenthesis are not needed really so I removed them in my example. In addition to the com port number, the other parameters after (i.e. 19200, n, 8, etc.) also need to be appropriate for whatever serial device you are trying to communicate with. Yes i have a serial port...it is right now set up as com2 here is the code i was playing with open "com2:19200,n,8,1,ds0,cs0,rs" for random as #comm print #comm,chr$(13) close #comm just simple dumb code to send a CR to the com port.... Darrin
|
|
|
Post by Rod on Sept 17, 2019 16:04:36 GMT -5
nport and portn are not the same name, simple as that? On my iPhone so can’t check but Liberty is robust and stable do you have something simple wrong.
|
|
|
Post by Carl Gundel on Sept 17, 2019 16:54:53 GMT -5
nport and portn was my typo. Sorry about that.
So the error happens when the port is opened or when you try to print to it? Step through it in the debugger.
|
|
|
Post by Rod on Sept 18, 2019 2:25:20 GMT -5
Away from home and my serial port test kit. But I am thinking it would be unusual for it to be Com2 . Darrin are you trying to SET it to Com2 by using that phrase in the open statement? If so that is not how it works. Windows assigns a Com Port number when the device is plugged in and you must use that number. Go here and browse the tutorial before moving on. alycesrestaurant.com/lbpe/AccessingSerialPort.html
|
|
|
Post by darrintn on Sept 18, 2019 6:37:23 GMT -5
Away from home and my serial port test kit. But I am thinking it would be unusual for it to be Com2 . Darrin are you trying to SET it to Com2 by using that phrase in the open statement? If so that is not how it works. Windows assigns a Com Port number when the device is plugged in and you must use that number. Go here and browse the tutorial before moving on. alycesrestaurant.com/lbpe/AccessingSerialPort.htmlYes, it is unusual for it to be com2, but i have it set as com2 through windows system device manager, the target system i am writing for has com1 already used for another device and so i set my system com1 to com2 and that way i do not have a com1. Using putty i can send and receive data on com2 to the device in question. I will check out the link and thanks again for all of your help. Darrintn
|
|
|
Post by Rod on Sept 18, 2019 11:01:20 GMT -5
Good. The error you mention, incorrect function, is not one I am familiar with. So to help us please run your program using the Ladybug icon. Then click on the single right arrow to step through the program a line st a time. Show us the syntax you have used in the line that the program fails on. Be sure you can see the bottom of the debugger window as there is an error reporting line st the foot of the window.
|
|
|
Post by Rod on Sept 18, 2019 11:01:29 GMT -5
Good. The error you mention, incorrect function, is not one I am familiar with. So to help us please run your program using the Ladybug icon. Then click on the single right arrow to step through the program a line st a time. Show us the syntax you have used in the line that the program fails on. Be sure you can see the bottom of the debugger window as there is an error reporting line st the foot of the window.
|
|
|
Post by darrintn on Sept 18, 2019 11:56:07 GMT -5
Good. The error you mention, incorrect function, is not one I am familiar with. So to help us please run your program using the Ladybug icon. Then click on the single right arrow to step through the program a line st a time. Show us the syntax you have used in the line that the program fails on. Be sure you can see the bottom of the debugger window as there is an error reporting line st the foot of the window. Ok, seems to work just fine now, i think i has some mistakes in my typing..... my bad... been very long time since i have typed a lot and i think if you will look back at my code ..... i open as #comm ... and was trying to print #com .... missing one of the m's ..... thanks everyone for your help. If i can get back into the habit of coding i will have to buy me a Pro version....... looking forward to playing around again in BASIC that is...... Darrintn
|
|