Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Wim Brul

Pages: 1 ... 6 7 [8] 9 10 ... 16
106
Applications / Re: Can I use a usb port as a com-port?
« on: March 22, 2017, 06:37:47 pm »
Hallo Lars,

Hallo Wim,

do you think that we will manage to fix USBCOM.SYS so that it will do what you now did with the help of USBCALLS.DLL ?
Obviously, USBCOM.SYS is the proper place to put this, in particular the vendor specific Setup. I remember that David Azariewicz added some specific code which I think he also took from file "pl2303.c" but maybe the vendor specific Setup is not working correctly yet.

Lars

I must say that I am not convinced that your current USBCOM.SYS cannot be used to drive the relays. It is my understanding that Roberto did not use an external power supply at that time. May be we did not try hard enough with slight modifications of my original script to get it working. We jumped to using the USBCALLS - REXX/2 External Functions.

I agree that USBCOM.SYS is the proper place to support serial communications thru the various pl2303 chip versions. Browsing the internet I learned that the very same vendor specific code is used again and again when someone supports the pl2303 in his code. It was originally derived from snooping what happens under windows. The actual working is unknown. I think that the VendorGetMagic calls are redundant i.e. the information obtained is not used. May be windows used it to probe what pl2303 version thy are dealing with.

In practice it is impossible to reliably fix USBCOM.SYS without the hardware at hand. Moreover it could break existing support for the various pl2302 hardware that people are currently using.

Wim

107
Applications / Re: Can I use a usb port as a com-port?
« on: March 21, 2017, 12:30:21 pm »
Hallo Roberto,

There is obviously some timing issue. You might try and test with sending only 1 data byte with RxUsbBulkWrite.
I could not see any improvement by modifying this value.
But if I improve disconnecting the power to the plate, restoring the laptop, and connecting the usb after restoration worked well. I even added it's rest of code and moved the relays.
It may be that the power supply is not stabilized, and this circuit requires more precision in the voltage.

I have seen reports on the internet that external power needed to be soldered to the power pin of the serial connector:

"Power the relay from the header pin instead of the power jack. There appears to be a big voltage drop on the power jack."

Quote
The only doubt I have is the numbering of relays. And the possible combination of starting two or more relays at the same time.

I prepared some example code that might help you out.

Code: [Select]
/* relay manipulation */
relays = x2c(b2x('11111111'));
say 'start with relays 1,2,3,4,5,6,7,8 off:' x2b(c2x(relays));

/* initialize relay switch masks */
r1off = x2c(b2x('00000001')); r1on = bitxor(r1off,relays);
r2off = x2c(b2x('00000010')); r2on = bitxor(r2off,relays);
r3off = x2c(b2x('00000100')); r3on = bitxor(r3off,relays);
r4off = x2c(b2x('00001000')); r4on = bitxor(r4off,relays);
r5off = x2c(b2x('00010000')); r5on = bitxor(r5off,relays);
r6off = x2c(b2x('00100000')); r6on = bitxor(r6off,relays);
r7off = x2c(b2x('01000000')); r7on = bitxor(r7off,relays);
r8off = x2c(b2x('10000000')); r8on = bitxor(r8off,relays);

/* relay switch example */
relays = bitand(relays,r1on);
relays = bitand(relays,r3on);
relays = bitand(relays,r5on);
relays = bitand(relays,r7on);
say 'now relays 1,3,5,7 on and 2,4,6,8,off:' x2b(c2x(relays));

/* relay switch example */
relays = bitor(relays,r1off);
relays = bitand(relays,r2on);
relays = bitor(relays,r3off);
relays = bitand(relays,r4on);
relays = bitor(relays,r5off);
relays = bitand(relays,r6on);
relays = bitor(relays,r7off);
relays = bitand(relays,r8on);
say 'now relays 1,3,5,7 off and 2,4,6,8,on:' x2b(c2x(relays));

/* relay switch example */
relays = bitor(relays,r8off);
relays = bitor(relays,r6off);
relays = bitor(relays,r4off);
relays = bitor(relays,r2off);
say 'stops with relays 1,2,3,4,5,6,7,8 off:' x2b(c2x(relays));

Regards

108
Applications / Re: Can I use a usb port as a com-port?
« on: March 20, 2017, 06:53:28 pm »
Hi Roberto,

Quote
The first time I ran it on the screen gave me this error
*RxUsbBulkRead(),RC=0x8050
The second time I run it but send to file, and give me error:
**RxUsbBulkRead(),RC=0x280

The RC=0x8050 means ERROR_HALTED_BABBLE. The device unexpectedly transmitted data to the host.
The RC=0x280 as you already know means timeout. The device did not transmit data to the host.

Quote
After this I unplug and plug the usb and give me this error:
*RxUsbBulkRead(),RC=0x0
 Data: AC
But only run well if I send to file, similar a urwin.cmd >mifile.txt

There is obviously some timing issue. You might try and test with sending only 1 data byte with RxUsbBulkWrite.

Quote
Now is nice.

Yes. Nice. We are getting there. Tomorrow I will put in some sleep instructions and see where that gets us.

109
Applications / Re: Can I use a usb port as a com-port?
« on: March 20, 2017, 03:43:17 pm »
Hallo Roberto,

I have added the vendor specific requests that seem to be required.

Code: [Select]
/* add UsbLoadFuncs */
rc = RxFuncAdd('UsbLoadFuncs','usbcalls','UsbLoadFuncs')
say '+UsbLoadFuncs(),RC=0x'd2x(rc)
/* invoke UsbLoadFuncs */
rc = ('' <> UsbLoadFuncs())
say '*UsbLoadFuncs(),RC=0x'b2x(rc)
/* drop UsbLoadFuncs */
rc = RxFuncDrop('UsbLoadFuncs')
say '-UsbLoadFuncs(),RC=0x'd2x(rc)

/* invoke RxUsbOpen */
drop Handle /* receives device handle */
EnumDevice=0 /* accept any free device */
idVendor=x2d(067B) /* vendor identifier */
idProduct=x2d(2303) /* product identifier */
bcdDevice=x2d(0300) /* device release number */
rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)
say '*RxUsbOpen(),RC=0x'd2x(rc)

/* invoke RxUsbDeviceSetConfiguration */
Config=1 /* configuration value to be set */
rc = RxUsbDeviceSetConfiguration(Handle,Config)
say '*RxUsbDeviceSetConfiguration(),RC=0x'd2x(rc)

/* vendor specific initialization */
call VendorGetMagic x2d(8484) x2d(0000)
call VendorSetMagic x2d(0404) x2d(0000)
call VendorGetMagic x2d(8484) x2d(0000)
call VendorGetMagic x2d(8383) x2d(0000)
call VendorGetMagic x2d(8484) x2d(0000)
call VendorSetMagic x2d(0404) x2d(0001)
call VendorGetMagic x2d(8484) x2d(0000)
call VendorGetMagic x2d(8383) x2d(0000)
call VendorSetMagic x2d(0000) x2d(0001)
call VendorSetMagic x2d(0001) x2d(0000)
call VendorSetMagic x2d(0002) x2d(0044)

/* invoke RxUsbCtrlMessage host-to-device */
Data=x2c(80250000 00 00 08) /* 9600,1,N,8 */
RequestType=x2d(21); Request=x2d(20) /* SetLineCoding interface class */
Value=x2d(0000); Index=x2d(0000); drop NumBytes; Timeout=100; /* interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,Data,Timeout)
say '*RxUsbCtrlMessage(SetLineCoding),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' BaudRate:' c2d(reverse(substr(Data,1,4)))
  say ' StopBits:' c2d(substr(Data,5,1))
  say ' ParyType:' c2d(substr(Data,6,1))
  say ' DataBits:' c2d(substr(Data,7,1))
end

/* invoke RxUsbCtrlMessage device-to-host */
drop Data /* receives string of data bytes read */
RequestType=x2d(A1); Request=x2d(21) /* GetLineCoding interface class */
Value=x2d(0000); Index=x2d(0000); NumBytes=7; Timeout=100; /* interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,Data,Timeout)
say '*RxUsbCtrlMessage(GetLineCoding),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' BaudRate:' c2d(reverse(substr(Data,1,4)))
  say ' StopBits:' c2d(substr(Data,5,1))
  say ' ParyType:' c2d(substr(Data,6,1))
  say ' DataBits:' c2d(substr(Data,7,1))
end

/* invoke RxUsbBulkWrite */
drop NumBytes /* receives number of data bytes written */
Endpoint=2; AltSetting=0; Data=copies(x2c(50),8); Timeout=8000
rc = RxUsbBulkWrite(Handle,Endpoint,AltSetting,NumBytes,Data,Timeout)
say '*RxUsbBulkWrite(),RC=0x'd2x(rc)

/* invoke RxUsbBulkRead */
drop Data /* receives string of data bytes read */
Endpoint=128+3; AltSetting=0; NumBytes=1; Timeout=8000
rc = RxUsbBulkRead(Handle,Endpoint,AltSetting,NumBytes,Data,Timeout)
say '*RxUsbBulkRead(),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' Data:' c2x(Data)
end

/* invoke RxUsbClose */
rc = RxUsbClose(Handle)
say '*RxUsbClose(),RC=0x'd2x(rc)

/* add UsbDropFuncs */
rc = RxFuncAdd('UsbDropFuncs','usbcalls','UsbdropFuncs')
say '+UsbDropFuncs(),RC=0x'd2x(rc)
/* invoke UsbDropFuncs */
rc = ('' <> UsbDropFuncs())
say '*UsbDropFuncs(),RC=0x'b2x(rc)
/* drop UsbDropFuncs */
rc = RxFuncDrop('UsbDropFuncs')
say '-UsbDropFuncs(),RC=0x'd2x(rc)
return

VendorGetMagic:
parse arg Value Index
/* invoke RxUsbCtrlMessage device-to-host */
RequestType=x2d(C0); Request=x2d(01); drop Data;
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,1,Data,100);
say '*RxUsbCtrlMessage(VendorGetMagic),RC=0x'd2x(rc);
return

VendorSetMagic:
parse arg Value Index
/* invoke RxUsbCtrlMessage host-to-device */
RequestType=x2d(40); Request=x2d(01); drop NumBytes;
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,,100);
say '*RxUsbCtrlMessage(VendorSetMagic),RC=0x'd2x(rc);
return

Regards

 

110
Applications / Re: Can I use a usb port as a com-port?
« on: March 19, 2017, 04:20:19 pm »
Hi Roberto,
I think that this file can help you, is the result from usbwrite.cmd, I attach.
I have that information already, but thanks anyway.
Quote
I do not undertand endpoint=128+3
endpoint=128+3 is the same as endpoint=x2d(83) and is the bulk input endpoint. The direction bit is 0x80 (hexadecimal) which is 128 (decimal) for input.
Quote
And *RxUsbBulkRead(),RC=0x280
the x280 when I wait for AC
The 0x280 is ERROR_TIMEOUT. The RxBulkRead waited 8 seconds for the 8 byte input. Please modify it to ask for only 1 byte. Perhaps that will work then.
Quote
By now is nice.
It could be better though.

Edited: I am now looking in pl2303.c from linux and I see that some vendor specific requests are required.
It is time for dinner now. After some study I will hopefully reply tomorrow.

Regards

111
Applications / Re: Can I use a usb port as a com-port?
« on: March 19, 2017, 11:08:04 am »
Hallo Roberto,

Quote
I have doubts, if I should include this line, because the pcboard says to speak English (usbtest.cmd), and I have the default system in code page 850.
 /* load all RexxUtil functions */
Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
Call SysLoadFuncs
rc=SysSetProcessCodePage(437)

That is not necessary. I think It only relates to the string descriptors.

The posted results are so far so good. Therefore I have rearranged and extended the script.
It sets DTR and RTS and tries to bulk write 8 bytes of 0x50 and to bulk read any response.

Code: [Select]
/* add UsbLoadFuncs */
rc = RxFuncAdd('UsbLoadFuncs','usbcalls','UsbLoadFuncs')
say '+UsbLoadFuncs(),RC=0x'd2x(rc)
/* invoke UsbLoadFuncs */
rc = ('' <> UsbLoadFuncs())
say '*UsbLoadFuncs(),RC=0x'b2x(rc)
/* drop UsbLoadFuncs */
rc = RxFuncDrop('UsbLoadFuncs')
say '-UsbLoadFuncs(),RC=0x'd2x(rc)

/* invoke RxUsbOpen */
drop Handle /* receives device handle */
EnumDevice=0 /* accept any free device */
idVendor=x2d(067B) /* vendor identifier */
idProduct=x2d(2303) /* product identifier */
bcdDevice=x2d(0300) /* device release number */
rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)
say '*RxUsbOpen(),RC=0x'd2x(rc)

/* invoke RxUsbDeviceSetConfiguration */
Config=1 /* configuration value to be set */
rc = RxUsbDeviceSetConfiguration(Handle,Config)
say '*RxUsbDeviceSetConfiguration(),RC=0x'd2x(rc)

/* invoke RxUsbCtrlMessage host-to-device */
Data=x2c(80250000 00 00 08) /* 9600,1,N,8 */
RequestType=x2d(21); Request=x2d(20) /* SetLineCoding interface class */
Value=x2d(0000); Index=x2d(0000); drop NumBytes; Timeout=8000; /* interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,Data,Timeout)
say '*RxUsbCtrlMessage(),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' BaudRate:' c2d(reverse(substr(Data,1,4)))
  say ' StopBits:' c2d(substr(Data,5,1))
  say ' ParyType:' c2d(substr(Data,6,1))
  say ' DataBits:' c2d(substr(Data,7,1))
end

/* invoke RxUsbCtrlMessage device-to-host */
drop Data /* receives string of data bytes read */
RequestType=x2d(A1); Request=x2d(21) /* GetLineCoding interface class */
Value=x2d(0000); Index=x2d(0000); NumBytes=7; Timeout=8000; /* interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,Data,Timeout)
say '*RxUsbCtrlMessage(),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' BaudRate:' c2d(reverse(substr(Data,1,4)))
  say ' StopBits:' c2d(substr(Data,5,1))
  say ' ParyType:' c2d(substr(Data,6,1))
  say ' DataBits:' c2d(substr(Data,7,1))
end

/* invoke RxUsbCtrlMessage host-to-device */
RequestType=x2d(21); Request=x2d(22) /* SetControlLineState interface class */
Value=x2d(0300); Index=x2d(0000); drop NumBytes; Timeout=8000; /* DTR=ON,RTS=ON,interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,,Timeout)
say '*RxUsbCtrlMessage(),RC=0x'd2x(rc)

/* invoke RxUsbBulkWrite */
drop NumBytes /* receives number of data bytes written */
Endpoint=2; AltSetting=0; Data=copies(x2c(50),8); Timeout=8000
rc = RxUsbBulkWrite(Handle,Endpoint,AltSetting,NumBytes,Data,Timeout)
say '*RxUsbBulkWrite(),RC=0x'd2x(rc)

/* invoke RxUsbBulkRead */
drop Data /* receives string of data bytes read */
Endpoint=128+3; AltSetting=0; NumBytes=8; Timeout=8000
rc = RxUsbBulkRead(Handle,Endpoint,AltSetting,NumBytes,Data,Timeout)
say '*RxUsbBulkRead(),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' Data:' c2x(Data)
end

/* invoke RxUsbClose */
rc = RxUsbClose(Handle)
say '*RxUsbClose(),RC=0x'd2x(rc)

/* add UsbDropFuncs */
rc = RxFuncAdd('UsbDropFuncs','usbcalls','UsbdropFuncs')
say '+UsbDropFuncs(),RC=0x'd2x(rc)
/* invoke UsbDropFuncs */
rc = ('' <> UsbDropFuncs())
say '*UsbDropFuncs(),RC=0x'b2x(rc)
/* drop UsbDropFuncs */
rc = RxFuncDrop('UsbDropFuncs')
say '-UsbDropFuncs(),RC=0x'd2x(rc)


Regards

112
Applications / Re: Can I use a usb port as a com-port?
« on: March 18, 2017, 04:18:10 pm »
Hallo Roberto,

Quote
At this point I can think of other possible solutions:
1- Open-close the port with rxusbcalls, and send the commands.The usbcalls work well.
2- Buy a USB cable to rs232, and connect it with two cables to the board. As David proposes. But it is possible that the converter cable has another 2303.
3- Use it as paperweights, hahaha.
I appreciate your opinion.

I would go for option 1 first.
So I prepared some rexx code that, to begin with, tries to get the current settings of baudrate, stopbits, parity and databits and to set these to 9600,N,8,1.
For this to work you need to rem out the usbcom.sys device driver statement in config.sys.
I modified Code Snippets taken from the "USBCALLS - REXX/2 Reference Guide".

Code: [Select]
/* add UsbLoadFuncs */
rc = RxFuncAdd('UsbLoadFuncs','usbcalls','UsbLoadFuncs')
say '+UsbLoadFuncs(),RC=0x'd2x(rc)
/* invoke UsbLoadFuncs */
rc = ('' <> UsbLoadFuncs())
say '*UsbLoadFuncs(),RC=0x'b2x(rc)
/* drop UsbLoadFuncs */
rc = RxFuncDrop('UsbLoadFuncs')
say '-UsbLoadFuncs(),RC=0x'd2x(rc)

/* invoke RxUsbOpen */
drop Handle /* receives device handle */
EnumDevice=0 /* accept any free device */
idVendor=x2d(067B) /* vendor identifier */
idProduct=x2d(2303) /* product identifier */
bcdDevice=x2d(0300) /* device release number */
rc = RxUsbOpen(Handle,EnumDevice,idVendor,idProduct,bcdDevice)
say '*RxUsbOpen(),RC=0x'd2x(rc)

/* invoke RxUsbDeviceSetConfiguration */
Config=1 /* configuration value to be set */
rc = RxUsbDeviceSetConfiguration(Handle,Config)
say '*RxUsbDeviceSetConfiguration(),RC=0x'd2x(rc)

/* invoke RxUsbCtrlMessage device-to-host */
drop Data /* receives string of data bytes read */
RequestType=x2d(A1); Request=x2d(21) /* GetLineCoding interface class */
Value=x2d(0000); Index=x2d(0000); NumBytes=7; Timeout=8000; /* interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,Data,Timeout)
say '*RxUsbCtrlMessage(),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' BaudRate:' c2x(reverse(substr(Data,1,4)))
  say ' StopBits:' c2x(substr(Data,5,1))
  say ' ParyType:' c2x(substr(Data,6,1))
  say ' DataBits:' c2x(substr(Data,7,1))
end

/* invoke RxUsbCtrlMessage host-to-device */
Data=x2c(80250000 00 00 08) /* 9600,N,8,1 */
RequestType=x2d(21); Request=x2d(20) /* SetLineCoding interface class */
Value=x2d(0000); Index=x2d(0000); drop NumBytes; Timeout=8000; /* interface 0 */
rc = RxUsbCtrlMessage(Handle,RequestType,Request,Value,Index,NumBytes,Data,Timeout)
say '*RxUsbCtrlMessage(),RC=0x'd2x(rc)
if (rc = 0) then do
  say ' BaudRate:' c2d(reverse(substr(Data,1,4)))
  say ' StopBits:' c2d(substr(Data,5,1))
  say ' ParyType:' c2d(substr(Data,6,1))
  say ' DataBits:' c2d(substr(Data,7,1))
end

/* invoke RxUsbClose */
rc = RxUsbClose(Handle)
say '*RxUsbClose(),RC=0x'd2x(rc)

/* add UsbDropFuncs */
rc = RxFuncAdd('UsbDropFuncs','usbcalls','UsbdropFuncs')
say '+UsbDropFuncs(),RC=0x'd2x(rc)
/* invoke UsbDropFuncs */
rc = ('' <> UsbDropFuncs())
say '*UsbDropFuncs(),RC=0x'b2x(rc)
/* drop UsbDropFuncs */
rc = RxFuncDrop('UsbDropFuncs')
say '-UsbDropFuncs(),RC=0x'd2x(rc)

   



 


113
Applications / Re: Do you really need DOS/WIN16 Support?
« on: March 17, 2017, 06:52:13 pm »
Quote
Do you really need DOS/WIN16 Support as OS/2 Warp offers it?

Yes I do because then I can keep on using my DOS/WIN16 programs.

Quote
1) Which DOS and Windows 3.1  applications are still needed ? Please list the name of it.

MDOS, 1986, IBM Wisepak Filing Assistant
MDOS, 1986, IBM Wisepak Reporting Assistant
MDOS, 1986, IBM Wisepak Writing Assistant
MDOS, 1986, PFM for COMPAQ computers/compatibles
MDOS, 1993, Adaptec CD-Player Utility
MDOS, 1993, IBM T - A Tiny Editor
MDOS, 1994, as65 Assembler for 6502 Microprocessor
MDOS, 1994, ULTIboard Printed Circuit Package
MDOS, 1994, ULTIcap Schematic Capture Package
MDOS, 2001, CCS64 Commodore 64 Software Emulator
MDOS, 2001, MPASM PIC16/17 Microcontroller Assembler

WINOS2, 1994, ULTIroute GXR Ripup/Retry Autorouter
WINOS2, 2001, MPASM PIC16/17 Microcontroller Assembler
WINOS2, 2001, MPLAB IDE for PIC16/17 Microcontrollers
WINOS2, 2001, PICSTART Plus Microcontroller Programmer


114
Applications / Re: Can I use a usb port as a com-port?
« on: March 16, 2017, 11:48:24 am »
Hallo Roberto,

Win, with usbcom.sys 10.215

MODE COM8:110,N,8,1,TO=ON
SYS0700: The baud rate 110 is not supported by the serial port hardware.

 I test with 110,150,300,9600,57600 and in all cases the same error.
Saludos

There are 3 things that you could do:

1. Try the valerius usbcom.sys driver.

2. Try the following MODE command:
Code: [Select]
/* setup communication mode */
'MODE '||ddName||',,N,8,1'

3. Try without the MODE command.

Regards

115
Applications / Re: Can I use a usb port as a com-port?
« on: March 15, 2017, 12:25:48 pm »
Quote
MODE COM8:9600,N,8,1,BUFFER=OFF,TO=ON
The MODE parameter BUFFER= is not supported by this COM port.

Use the following code instead:

Code: [Select]
/* setup communication mode */
'MODE '||ddName||':9600,N,8,1,TO=ON'

Quote
obtaining response
response:

Add the /Z switch to the device driver statement.

Code: [Select]
DEVICE=C:\OS2\BOOT\USBCOM.SYS /M:1 /N:COM8 /V /Z

The /Z switch is special for PL-2303 and 2 wire communication.

116
Applications / Re: Can I use a usb port as a com-port?
« on: March 14, 2017, 04:49:56 pm »
Hi Roberto,

I do not have that relay board, but may be the following code will be of help. Try it and see what it does.

Code: [Select]
/* write/read to/from relay device */
rc=RxFuncAdd('SysSleep','RexxUtil','SysSleep')

/* set com port*/
ddName = 'COM8'

/* protect the file system from inadvertent access */
if stream(ddName,'command','query exists') \= '\DEV\' || ddName
then do
  say 'ERROR: The device driver' ddName 'does not exist!'
  /* wait */
  '@pause'
  exit
  end

/* setup communication mode */
'MODE '||ddName||':9600,N,8,1,BUFFER=OFF,TO=ON'

/* acquire the device driver */
rc=stream(ddName,'command','open')
if rc \= 'READY:'
then do
  say rc 'Device driver' ddName 'currently in use. Please try later.'
  /* wait */
  '@pause'
  exit
  end

/* send 0x50 command */
say 'sending 0x50 command'
rc = charout(ddName,x2c(50))
call SysSleep(0.030)

/* obtain response */
say 'obtaining response'
response = charin(ddName,,1)
say 'response: 'c2x(response)
call SysSleep(0.030)

/* send 0x51 command */
say 'sending 0x51 command'
rc = charout(ddName,x2c(51))
call SysSleep(0.030)

/* switch relays off */
say 'sending 0xFF control'
rc = charout(ddName,x2c(FF))
call SysSleep(0.030)

/* switch relay 1 on */
say 'sending 0xFE control'
rc = charout(ddName,x2c(FE))
call SysSleep(0.030)

/* wait 5 seconds */
say 'waiting 5 seconds'
call SysSleep(5)

/* switch relays off */
say 'sending 0xFF control'
rc = charout(ddName,x2c(FF))
call SysSleep(0.030)

/* release the device driver */
rc=stream(ddName,'command','close')

Regards

117
Applications / Re: Can I use a usb port as a com-port?
« on: March 13, 2017, 12:01:44 pm »
Hallo Roberto,

DEVICE=C:\OS2\BOOT\USBCOM.SYS /M:1 /N:COM8 /V

Did you succeed in controlling your relay board?

What does MODE COM8 report?

Regards

118
Multimedia / Re: USB Audio
« on: March 13, 2017, 11:51:12 am »
Hallo Roberto,

Quote
The question, Is it normal for the device list to show me the internal devices?
And I ask this because I only have two accessories connected. One wifi mouse, and relay board2303.
When I show the other two internal usb, if I pulse the wifi on / off one of them disappears and appears.

It is normal that both the internal and external connected devices are shown in the device list.
It is possible on some systems  that the bios allows you to enable/disable internal connected devices.
There are devices that disappear/ reappear as part of their device specific initialization sequence.

The 03F0:231D device - Broadcom Corp HP Integrated Module - is one of those device that first appears as one type of device and later on (after disappear/reappear) shows op as a different type of device.

The 138A:0007 device - is your Fingerprint Reader.

Regards

119
Multimedia / Re: USB Audio
« on: March 12, 2017, 05:01:08 pm »
For proper result you MUST have DEVICE=C:\OS2\BOOT\USBRESMG.SYS in your CONFIG.SYS file. If you REM it out then you get RC=0x1B58.
I ran your script over here and I get USBCALLS 14.210  and USBRESMG 14.210 which is correct for with my latest set.

120
Multimedia / Re: USB Audio
« on: March 09, 2017, 12:37:59 pm »
Quote
About drop outs in Firefox: maybe that cannot fully be avoided. It might happen on high interrupt load. Isochronous transfer will lead to a fairly steady interrupt load. If something else is busy in the system (hard disk etc.) that might lead to a delay in interrupt processing.

Most likely the drop outs of sound in firefox occur when the sample rate is too low to be handled in time. It probably occurred when the sound was playing too fast. The usb audio driver goes into a kind of overdrive to spit out the 16 bit stereo sound samples at a rate of 44.1 kHz. whereas the application produces say 8 bit mono sound at 8 kHz. hence lack of samples occur  i.e. drop out of sound. Moreover the overdrive operation results in an interrupt load that is in this case 2*2*44100/8000 i.e. 22 times so high. I am having sound dropouts when I play the macaw.avi file which produces 8 bit mono sound at 22.050 kHz.

Wim

Pages: 1 ... 6 7 [8] 9 10 ... 16