channelaccess / ca_matlab

4 stars 2 forks source link

Matlab hangs when reading integer array #10

Closed wkoprek closed 8 years ago

wkoprek commented 8 years ago

Here is the Matlab code which three EPICS records. String and scalar integer work, but when I execute get() on integer array, then Matlab hangs and the only thing I can do is killing the process. Sorry for the source code formatting.

init_ibfb.m

if not(exist('java_classpath_set')) javaaddpath('ca_matlab-1.0.0.jar') java_classpath_set = 1; end

import ch.psi.jcae.*

% Use of SLS configuration properties = java.util.Properties(); properties.setProperty('EPICS_CA_ADDR_LIST', '129.129.130.255'); %properties.setProperty('EPICS_CA_SERVER_PORT', '5062');

context = Context(properties);

ibfb = ca_ibfb(context);

This is my record definition:

record(aao, "$(DEV):QSFP1-MEM") { field(SCAN, "I/O Intr") field(DTYP, "S7gpac") field(OUT, "@$(SRV)/0x00004:0x00004 T=UINT32") field(NELM, "16384") field(FTVL, "LONG") }

ca_ibfb.m

classdef ca_ibfb properties gpac_sn qsfp1_mem y_updown_packets end

methods % Constructor of class function obj = ca_ibfb(context) import ch.psi.jcae.* obj.gpac_sn = Channels.create(context, ChannelDescriptor('string' , 'IBFBCTRL:GPAC2-SN' )); obj.y_updown_packets = Channels.create(context, ChannelDescriptor('integer' , 'IBFBCTRL:Y-UPDOWN-PACKETS' )); obj.qsfp1_mem = Channels.create(context, ChannelDescriptor('integer[]', 'IBFBPLAYER:QSFP1-MEM' )); end % Destructor function delete(obj) obj.gpac_sn.close(); obj.qsfp1_mem.close(); obj.y_updown_packets.close();
end end end

and this call hangs

clear all init_ibfb ibfb.qsfp1_mem.get()

wkoprek commented 8 years ago

The problem is solved. My array has size of 65536 bytes and setting the EPICS_CA_MAX_ARRAY_BYTES to bigger value helped. Sorry for bothering :)